Skip to content

Commit

Permalink
ci(github-actions): only push image on tags and releases
Browse files Browse the repository at this point in the history
  • Loading branch information
danvergara committed Jan 25, 2024
1 parent d9ef1b8 commit a50882d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 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,4 @@ 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 }}

0 comments on commit a50882d

Please sign in to comment.