From 4f69cbba9772cc80c8421d37b189686eaca85dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 3 Apr 2024 14:28:28 +0200 Subject: [PATCH] CI: add workflow for publishing Docker image --- .github/workflows/publish-image.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/publish-image.yml diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml new file mode 100644 index 0000000..fa0ef5d --- /dev/null +++ b/.github/workflows/publish-image.yml @@ -0,0 +1,30 @@ +name: Publish Docker image to ghcr.io + +permissions: + packages: write + +on: + push: + tags: + - 'v*' + +jobs: + test: + name: Publish image + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: kobzol + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/setup-buildx-action@v3 + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + push: true + tags: ghcr.io/kobzol/cargo-pgo:${{ github.ref_name }},ghcr.io/kobzol/cargo-pgo:latest