diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..1f16937 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,38 @@ +name: Docker Image CI + +on: + push: + tags: + - 'v*' + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: [actions/checkout](https://github.com)@v4 + + - name: Log in to GHCR + uses: [docker/login-action](https://github.com)@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: [docker/metadata-action](https://github.com)@v5 + with: + images: ghcr.io/${{ github.repository }} + + - name: Build and push Docker image + uses: [docker/build-push-action](https://github.com/docker/build-push-action)@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}