diff --git a/.github/workflows/CDImage.yml b/.github/workflows/CDImage.yml index b97ff2c..c9b8b80 100644 --- a/.github/workflows/CDImage.yml +++ b/.github/workflows/CDImage.yml @@ -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 @@ -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