From 048a8ac95d58485cd5df44cf289d82761742ac35 Mon Sep 17 00:00:00 2001 From: Tim Goudriaan Date: Mon, 27 May 2024 22:57:49 +0200 Subject: [PATCH] Add GitHub action to publish Docker image --- .github/workflows/publish.yaml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..614764d --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,38 @@ +name: Publish Docker image + +on: push + +jobs: + publish-images: + name: Publish Docker Images + runs-on: ubuntu-latest + steps: + - + name: Check out repo + uses: actions/checkout@v4 + + - + name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }} + + - + name: Login to GitHub Packages + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - + name: Build and push Docker image + id: push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}