Skip to content

Commit

Permalink
add container dev tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ru-asdx committed Dec 20, 2024
1 parent 98d85df commit ee6acb7
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ jobs:
id: tag
run: |
IMAGE_TAG="0.0.0"
IMAGE_TAG_DEV="dev-${GITHUB_SHA:0:7}-$(date +%s)"
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
REF=${{ github.ref }};
TAG_FULL=${REF#refs/*/};
IMAGE_TAG=${TAG_FULL//\//_};
fi
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
echo "image_tag_dev=${IMAGE_TAG_DEV}" >> $GITHUB_OUTPUT
- name: 'Set up QEMU'
uses: docker/setup-qemu-action@v2
Expand All @@ -41,16 +43,33 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: 'Build and push'
id: docker_build
- name: 'Build and push dev image'
if: ${{ steps.tag.outputs.image_tag == '0.0.0' }}
id: docker_build_dev
uses: docker/build-push-action@v4
with:
push: true
tags: |
ghcr.io/flipperdevices/flpr.app:${{steps.tag.outputs.image_tag}}
ghcr.io/flipperdevices/flpr.app:${{steps.tag.outputs.image_tag_dev}}
- name: 'Build and push prod image'
if: ${{ steps.tag.outputs.image_tag != '0.0.0' }}
id: docker_build_prod
uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/flipperdevices/flpr.app:${{steps.tag.outputs.image_tag}}

- name: 'Image digest'
- name: 'Show dev image digest'
if: ${{ steps.tag.outputs.image_tag == '0.0.0' }}
run: |
echo ${{ steps.docker_build_dev.outputs.digest }}
- name: 'Show prod image digest'
if: ${{ steps.tag.outputs.image_tag != '0.0.0' }}
run: |
echo ${{ steps.docker_build.outputs.digest }}
echo ${{ steps.docker_build_prod.outputs.digest }}
- name: 'Trigger k8s to use new image'
uses: peter-evans/repository-dispatch@v2
Expand Down

0 comments on commit ee6acb7

Please sign in to comment.