Skip to content

Commit

Permalink
DCJ-516: Use Workload Identity (#2629)
Browse files Browse the repository at this point in the history
  • Loading branch information
rushtong authored Jul 24, 2024
1 parent 8fa2948 commit 4484892
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ cypress.env.json
ca-bundle.crt
server.crt
server.key
site.conf
site.conf

## GHA Credentials
gha-creds-*.json

0 comments on commit 4484892

Please sign in to comment.