Created
November 24, 2022 16:40
-
-
Save arslanbekov/47f02483561a7fbefa2f8982cb4c0d23 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
name: "Example Workload Identity" | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
run: | |
name: "Workload Identity Job" | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Auth in GCP" | |
id: "auth" | |
uses: "google-github-actions/auth@v1" | |
with: | |
token_format: "access_token" | |
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER_NAME }} | |
service_account: ${{ secrets.GCP_WORKLOAD_IDENTITY_SA_EMAIL }} | |
- name: "Docker login" | |
run: | | |
echo '${{ steps.auth.outputs.access_token }}' | docker login -u oauth2accesstoken --password-stdin https://gcr.io |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment