Skip to content

Commit

Permalink
add oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisooo790926 committed Oct 18, 2023
1 parent fe4dea3 commit 5addbca
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:
version:
default: '0.0.1'
type: string
secrets:
GH_PAT:
required: true

jobs:
build-all:
if: ${{ inputs.build-services == 'contract' }}
Expand Down Expand Up @@ -57,6 +53,15 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GH_PAT }}

- name: Authenticate to Google Cloud
id: auth
uses: 'google-github-actions/auth@v1'
with:
token_format: access_token
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}'
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}'
access_token_lifetime: 300s

- name: Login Registry
id: docker-auth
uses: docker/login-action@v1
Expand Down Expand Up @@ -93,6 +98,9 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v3

- name: Test
run: echo ${{ secrets.WIF_PROVIDER }}

- name: Setup circom, related lib
run: |
apt-get update && apt-get install -y build-essential curl
Expand All @@ -108,6 +116,15 @@ jobs:
- name: Install and build packages
run: yarn && yarn build

- name: Authenticate to Google Cloud
id: auth
uses: 'google-github-actions/auth@v1'
with:
token_format: access_token
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}'
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}'
access_token_lifetime: 300s

- name: Login Registry
id: docker-auth
uses: docker/login-action@v1
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/main-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: CD-Main
run-name: ${{ github.actor }} acitvates the actions 🚀

on:
push:
workflow_dispatch:
branches: ['feat_system_cicd_enhancment']
inputs:
Expand All @@ -25,8 +24,7 @@ jobs:
with:
build-services: ${{ inputs.build-services }}
version: ${{ inputs.version }}
secrets:
GH_PAT: ${{ secrets.GH_PAT }}
secrets: inherit

backend:
needs: build
Expand Down

0 comments on commit 5addbca

Please sign in to comment.