Skip to content

Commit

Permalink
push latest tag to ACR
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Dec 11, 2024
1 parent 06fb153 commit 77780fd
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ jobs:
run: |
sha=${GITHUB_SHA::8}
ts=$(date +%s)
echo "tag=${GITHUB_REF_NAME}-${sha}-${ts}" >> $GITHUB_OUTPUT
echo "fullname=ghcr.io/${{ github.repository }}:${GITHUB_REF_NAME}-${sha}-${ts}" >> $GITHUB_OUTPUT
tag=${GITHUB_REF_NAME}-${sha}-${ts}
echo "tag=$tag" >> $GITHUB_OUTPUT
echo "fullname=ghcr.io/${{ github.repository }}:$tag" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -55,7 +56,7 @@ jobs:
runs-on: ubuntu-20.04
name: Build Pipeline runner
outputs:
tag: ${{ steps.metadata.outputs.tag }}
tag_latest: ${{ steps.metadata.outputs.tag_latest }}
fullname: ${{ steps.metadata.outputs.fullname }}
steps:
- uses: actions/checkout@v4
Expand All @@ -72,8 +73,12 @@ jobs:
run: |
sha=${GITHUB_SHA::8}
ts=$(date +%s)
echo "tag=${GITHUB_REF_NAME}-latest" >> $GITHUB_OUTPUT
echo "fullname=ghcr.io/${{ github.repository }}:${GITHUB_REF_NAME}-${sha}-${ts}" >> $GITHUB_OUTPUT
tag_latest=${GITHUB_REF_NAME}-latest
tag=${GITHUB_REF_NAME}-${sha}-${ts}
echo "tag=$tag" >> $GITHUB_OUTPUT
echo "tag_latest=$tag_latest" >> $GITHUB_OUTPUT
echo "fullname=ghcr.io/${{ github.repository }}:$tag" >> $GITHUB_OUTPUT
echo "fullname_latest=ghcr.io/${{ github.repository }}:$tag_latest" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -87,7 +92,10 @@ jobs:
platforms: |
linux/amd64
linux/arm64
tags: "${{ steps.metadata.outputs.fullname }}"
tags: |
${{ steps.metadata.outputs.fullname }}
${{ steps.metadata.outputs.fullname_latest }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down Expand Up @@ -169,7 +177,7 @@ jobs:
id: metadata
run: |
echo "operator=${{ matrix.target.acr-name }}.azurecr.io/radix-operator:${{ needs.build-operator.outputs.tag }}" >> $GITHUB_OUTPUT
echo "pipeline=${{ matrix.target.acr-name }}.azurecr.io/radix-pipeline:${{ needs.build-pipelinerunner.outputs.tag }}" >> $GITHUB_OUTPUT
echo "pipeline=${{ matrix.target.acr-name }}.azurecr.io/radix-pipeline:${{ needs.build-pipelinerunner.outputs.tag_latest }}" >> $GITHUB_OUTPUT
- name: ACR Login
run: az acr login --name ${{ matrix.target.acr-name }}
Expand All @@ -183,7 +191,7 @@ jobs:
- name: Re-Tag Operator
run: docker tag ${{ needs.build-operator.outputs.fullname }} ${{ steps.metadata.outputs.operator }}

- name: Re-Tag Pipeline Runner
- name: Re-Tag PipelineRunner
run: docker tag ${{ needs.build-pipelinerunner.outputs.fullname }} ${{ steps.metadata.outputs.pipeline }}

- name: Push Operator to Target Registry
Expand Down

0 comments on commit 77780fd

Please sign in to comment.