-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix docker login for oauth logins
- Loading branch information
Showing
5 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,6 +313,77 @@ jobs: | |
grep -q 'ARG IMAGE_REGISTRY=ghcr.io/blue-build' Containerfile || exit 1 | ||
bluebuild build --retry-push -S sigstore --push -vv recipes/recipe.yml recipes/recipe-39.yml | ||
docker-build-oauth-login: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
needs: | ||
- build | ||
if: needs.build.outputs.push == 'true' | ||
|
||
steps: | ||
- name: Maximize build space | ||
uses: ublue-os/remove-unwanted-software@v6 | ||
|
||
- uses: sigstore/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
install: true | ||
|
||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{github.event.pull_request.head.ref}} | ||
repository: ${{github.event.pull_request.head.repo.full_name}} | ||
|
||
- name: Google Auth | ||
id: auth | ||
uses: "google-github-actions/auth@v2" | ||
with: | ||
token_format: "access_token" | ||
service_account: ${{ secrets.SERVICE_ACCOUNT }} | ||
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY }} | ||
|
||
- name: Docker Auth | ||
id: docker-auth | ||
uses: "docker/login-action@v3" | ||
with: | ||
username: "oauth2accesstoken" | ||
password: "${{ steps.auth.outputs.access_token }}" | ||
registry: us-east1-docker.pkg.dev | ||
|
||
- name: Install bluebuild | ||
run: | | ||
cargo install --path . --debug --all-features | ||
- name: Expose GitHub Runtime | ||
uses: crazy-max/ghaction-github-runtime@v3 | ||
|
||
- name: Run Build | ||
env: | ||
GH_PR_EVENT_NUMBER: ${{ github.event.number }} | ||
COSIGN_PRIVATE_KEY: ${{ secrets.TEST_SIGNING_SECRET }} | ||
BB_BUILDKIT_CACHE_GHA: true | ||
run: | | ||
cd integration-tests/test-repo | ||
bluebuild template -vv | tee Containerfile | ||
grep -q 'ARG IMAGE_REGISTRY=ghcr.io/blue-build' Containerfile || exit 1 | ||
bluebuild build \ | ||
--registry us-east1-docker.pkg.dev \ | ||
--registry-namespace bluebuild-oidc/bluebuild \ | ||
--retry-push \ | ||
-S sigstore \ | ||
--push \ | ||
-vv \ | ||
recipes/recipe.yml recipes/recipe-39.yml | ||
podman-build: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters