Skip to content

Commit

Permalink
Use identity provider
Browse files Browse the repository at this point in the history
  • Loading branch information
yurushao committed Jun 12, 2024
1 parent d16f2f7 commit ffc7130
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy_api.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Deploy api to GAE

on:
pull_request:
branches: ["main"]
# pull_request:
# branches: ["main"]

workflow_dispatch:
inputs:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/gcp_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: List services in GCP
on:
pull_request:
branches:
- main

permissions:
id-token: write

jobs:
Get_OIDC_ID_token:
runs-on: ubuntu-latest
steps:
- id: "auth"
name: "Authenticate to GCP"
uses: "google-github-actions/auth@v0.3.1"
with:
create_credentials_file: "true"
workload_identity_provider: "https://iam.googleapis.com/projects/639940077006/locations/global/workloadIdentityPools/github-workflow/providers/github"
service_account: "glam-api-419002@appspot.gserviceaccount.com"
- id: "gcloud"
name: "gcloud"
run: |-
gcloud auth login --brief --cred-file="${{ steps.auth.outputs.credentials_file_path }}"
gcloud services list
2 changes: 1 addition & 1 deletion .github/workflows/pr_test_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: ["main"]
paths:
- "api/**"
- ".github/workflows/**"
# - ".github/workflows/**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down

0 comments on commit ffc7130

Please sign in to comment.