From a1a865be2b34673de66e6962d2779e577496c500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Omar=20Vergara=20P=C3=A9rez?= Date: Thu, 25 Jan 2024 19:34:30 -0600 Subject: [PATCH] Only push image on tags and releases (#30) * ci(github-actions): only push image on tags and release --- .github/workflows/deploy_image.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_image.yml b/.github/workflows/deploy_image.yml index 666a954..f94299a 100644 --- a/.github/workflows/deploy_image.yml +++ b/.github/workflows/deploy_image.yml @@ -2,11 +2,8 @@ name: Deploy Morphos Server Container Image on: push: - branches: - - main - -env: - GO_VERSION: 1.21.5 + tags: + - '[0-9]+.[0-9]+.[0-9]+' # Only build on tag with semantic versioning format jobs: push_morphos_image: @@ -18,6 +15,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set up QEMU + - name: Set release tag env variable + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -33,4 +32,6 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: true - tags: ghcr.io/${{ github.actor }}/morphos-server:latest + tags: ghcr.io/${{ github.actor }}/morphos-server:latest, ghcr.io/${{ github.actor }}/morphos-server:${{ env.RELEASE_VERSION }} + - name: Release + uses: softprops/action-gh-release@v1