Skip to content

Commit

Permalink
Only push image on tags and releases (#30)
Browse files Browse the repository at this point in the history
* ci(github-actions): only push image on tags and release
  • Loading branch information
danvergara authored Jan 26, 2024
1 parent 9764d13 commit a1a865b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/deploy_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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

0 comments on commit a1a865b

Please sign in to comment.