Skip to content

Commit

Permalink
ci: tagging and composite docker image improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
morbalint committed Mar 8, 2024
1 parent ffa0c24 commit 37dd40f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ jobs:
- uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- run: |
echo "GITHUB_SHA_SHORT=$(echo ${GITHUB_SHA::8})" >> $GITHUB_ENV
- uses: docker/build-push-action@v5
with:
context: .
file: Kemkas.Web/Composite.Dockerfile
args: FE_TAG=${GITHUB_SHA::8},BE_TAG=${GITHUB_SHA::8}
args: FE_TAG=${{ env.GITHUB_SHA_SHORT }},BE_TAG=${{ env.GITHUB_SHA_SHORT }}
cache-from: type=gha
cache-to: type=gha,mode=max
push: false
Expand Down Expand Up @@ -185,7 +187,11 @@ jobs:
export DOCKER_IMAGE_ID=$(docker images ghcr.io/${{ github.repository_owner }}/kemkas:${GITHUB_SHA::8} --format "{{.ID}}")
export DOCKER_IMAGE_ID=GHCR-$DOCKER_IMAGE_ID
echo "DOCKER_IMAGE_ID=$DOCKER_IMAGE_ID" >> $GITHUB_ENV
- uses: mukunku/[email protected]
with:
tag: ${{ env.DOCKER_IMAGE_ID }}
- name: Tag commit with docker image ID
if: steps.check-tag.outputs.exists == 'false'
uses: actions/github-script@v5
with:
script: |
Expand Down

0 comments on commit 37dd40f

Please sign in to comment.