Skip to content

Commit

Permalink
DCJ-516: Use Workload Identity (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
rushtong committed Jul 24, 2024
1 parent c4a7de9 commit 502c959
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
runs-on: ubuntu-latest
outputs:
sherlock-version: ${{ steps.short-sha.outputs.sha }}
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -44,17 +47,18 @@ jobs:
.
- name: Log Github Actor
run: echo "${{ github.actor }}"
- name: Auth to GCR
- id: 'auth'
if: github.actor != 'dependabot[bot]'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCR_PUBLISH_KEY_B64 }}
- name: Auth Docker for GCR
if: github.actor != 'dependabot[bot]'
run: gcloud auth configure-docker --quiet
# Centralized in dsp-tools-k8s; ask in #dsp-devops-champions for help troubleshooting
workload_identity_provider: 'projects/1038484894585/locations/global/workloadIdentityPools/github-wi-pool/providers/github-wi-provider'
service_account: '[email protected]'
- name: Push Image to GCR
if: github.actor != 'dependabot[bot]'
run: |
gcloud auth configure-docker --quiet
docker push ${{ steps.construct-tags.outputs.sha-tag }}
docker push ${{ steps.construct-tags.outputs.environment-tag }}
report-to-sherlock:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ src/main/resources/assets/oauth2-redirect.html

# vscode
.vscode/

## GHA Credentials
gha-creds-*.json

0 comments on commit 502c959

Please sign in to comment.