From 3cd61fae3898b24f456ab7fc9aad7e1ce151e56d Mon Sep 17 00:00:00 2001 From: Anxo Rodriguez Date: Tue, 3 Oct 2023 10:00:51 +0100 Subject: [PATCH] Publish docker images (#8) * Publish docker image on push to main and new tagged version * Test in PR * Revert "Test in PR" This reverts commit eb2b675e396c010c5298cf2f8a250d33e7d3f0e7. --- .github/workflows/docker.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..af0b194 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,35 @@ +name: Publish Docker image + +on: + push: + branches: [main] + tags: [v*] + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Image metadata + id: image_meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile + push: true + tags: ${{ steps.image_meta.outputs.tags }} + labels: ${{ steps.image_meta.outputs.labels }}