Skip to content

chore: Rewrite - use PostgreSQL #1

chore: Rewrite - use PostgreSQL

chore: Rewrite - use PostgreSQL #1

name: Publish Docker Image to GHCR
on:
push:
branches:
- main
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Extract Version from Git
id: get_version
run: |
VERSION=$(date +"0.%Y%m%d%H%M")
echo "version=$VERSION" >> $GITHUB_ENV
- name: 'Build'
run: |
docker build . --tag ghcr.io/edelstadt/redis-logger:${{ env.version }} -f Containerfile
docker push ghcr.io/edelstadt/redis-logger:${{ env.version }}
docker tag ghcr.io/edelstadt/redis-logger:${{ env.version }} ghcr.io/edelstadt/redis-logger:latest
docker push ghcr.io/edelstadt/redis-logger:latest
- name: Show Image Digest
run: |
echo "Published Docker image with tags: latest and ${{ env.version }}"