Skip to content

Commit

Permalink
Make Image on Tag
Browse files Browse the repository at this point in the history
  • Loading branch information
KSkwarczynski authored Oct 10, 2024
1 parent a829f18 commit a54045c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/CDImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name: Image CD
# The events that trigger the workflow
on:
push:
branches: [ main ]
release:
types: [ published ]
branches:
- develop
tags:
- 'v*'

permissions:
contents: read
Expand Down Expand Up @@ -33,16 +34,16 @@ jobs:

- name: Build Docker image
run: |
if [ "${{ github.event_name }}" == 'release' ]; then
docker build . --file ${{ matrix.file }} --tag ghcr.io/${{ github.repository_owner }}/mach3tutorial:${{ matrix.os }}v${{ github.event.release.tag_name }} --build-arg MACH3_VERSION=main
if [ "${{ github.event_name }}" == 'tag' ]; then
docker build . --file ${{ matrix.file }} --tag ghcr.io/${{ github.repository_owner }}/mach3tutorial:${{ matrix.os }}${{ github.ref_name }} --build-arg MACH3_VERSION=main
else
docker build . --file ${{ matrix.file }} --tag ghcr.io/${{ github.repository_owner }}/mach3tutorial:${{ matrix.tag_latest }} --build-arg MACH3_VERSION=main
fi
- name: Push Docker image
run: |
if [ "${{ github.event_name }}" == 'release' ]; then
docker push ghcr.io/${{ github.repository_owner }}/mach3tutorial:${{ matrix.os }}v${{ github.event.release.tag_name }}
if [ "${{ github.event_name }}" == 'tag' ]; then
docker push ghcr.io/${{ github.repository_owner }}/mach3tutorial:${{ matrix.os }}${{ github.ref_name }}
else
docker push ghcr.io/${{ github.repository_owner }}/mach3tutorial:${{ matrix.tag_latest }}
fi

0 comments on commit a54045c

Please sign in to comment.