Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log in to GHCR to enable cache #1251

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Build Operator
outputs:
tag: ${{ steps.metadata.outputs.tag }}
fullname: ${{ steps.metadata.outputs.fullname }}
fullname_latest: ${{ steps.metadata.outputs.fullname_latest }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -62,8 +62,7 @@ jobs:
name: Build Pipeline runner
outputs:
tag_latest: ${{ steps.metadata.outputs.tag_latest }}
tag: ${{ steps.metadata.outputs.tag }}
fullname: ${{ steps.metadata.outputs.fullname }}
fullname_latest: ${{ steps.metadata.outputs.fullname_latest }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -166,6 +165,13 @@ jobs:
- name: ACR Login
run: az acr login --name ${{ matrix.target.acr-name }}

- name: GHCR Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -180,8 +186,8 @@ jobs:
linux/arm64
tags: |
${{ steps.metadata.outputs.operator }}
cache-from: "type=registry,ref=${{ needs.build-operator.outputs.fullname }}-buildcache"
cache-to: "type=registry,ref=${{ needs.build-operator.outputs.fullname }}-buildcache,mode=max"
cache-from: "type=registry,ref=${{ needs.build-operator.outputs.fullname_latest }}-buildcache"
cache-to: "type=registry,ref=${{ needs.build-operator.outputs.fullname_latest }}-buildcache,mode=max"

- name: Build and push pipeline-runner docker image
uses: docker/build-push-action@v5
Expand All @@ -194,8 +200,8 @@ jobs:
linux/arm64
tags: |
${{ steps.metadata.outputs.pipeline_latest }}
cache-from: "type=registry,ref=${{ needs.build-pipelinerunner.outputs.fullname }}-buildcache"
cache-to: "type=registry,ref=${{ needs.build-pipelinerunner.outputs.fullname }}-buildcache,mode=max"
cache-from: "type=registry,ref=${{ needs.build-pipelinerunner.outputs.fullname_latest }}-buildcache"
cache-to: "type=registry,ref=${{ needs.build-pipelinerunner.outputs.fullname_latest }}-buildcache,mode=max"

- name: Revoke GitHub IP on ACR
if: ${{ steps.update_firewall.outcome == 'success' && !cancelled()}} # Always run this step even if previous step failed
Expand Down
Loading