Skip to content

Commit

Permalink
Remove github service account keys and replace them with OIDC (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
nerahou authored Aug 3, 2023
1 parent 732c004 commit 77aaa2f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
build-and-push:
name: BuildAndPush
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'

env:
IMAGE_NAME: prometheus-sleeker
Expand All @@ -22,7 +25,7 @@ jobs:
steps:
# This step uses Github's checkout-action: https://github.com/actions/checkout
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

# Deduced the appropriate tag for the image (inspired by the docker action https://github.com/actions-hub/docker)
- name: Set env
Expand All @@ -38,11 +41,11 @@ jobs:
fi && \
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
# Setup gcloud CLI
- uses: google-github-actions/[email protected]
- uses: google-github-actions/auth@v1
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: ${{ env.GCP_PROJECT_ID }}
export_default_credentials: true
token_format: 'access_token'
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_POOL }}
service_account: ${{ env.SERVICE_ACCOUNT }}

# Build docker image
- name: Build
Expand Down

0 comments on commit 77aaa2f

Please sign in to comment.