From be50e8625e18a3f646df1dde623febcd819855b2 Mon Sep 17 00:00:00 2001 From: Reinaldo Costa Date: Tue, 2 Apr 2024 11:13:19 -0300 Subject: [PATCH 1/5] chore: add test workflow --- .github/workflows/tt.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/tt.yaml diff --git a/.github/workflows/tt.yaml b/.github/workflows/tt.yaml new file mode 100644 index 0000000..dadbfdc --- /dev/null +++ b/.github/workflows/tt.yaml @@ -0,0 +1,29 @@ +name: Deploy + +on: + push: + branches: + - develop + +jobs: + job_id: + runs-on: 'ubuntu-latest' + # Add "id-token" with the intended permissions. + permissions: + contents: 'read' + id-token: 'write' + + steps: + - id: 'auth' + uses: 'google-github-actions/auth@v2' + with: + workload_identity_provider: 'projects/195139564832/locations/global/workloadIdentityPools/my-pool/providers/my-provider' + service_account: 'action-deployer@gtp-reinaldo-study-0001.iam.gserviceaccount.com' + + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v2' + with: + version: '>= 363.0.0' + + - name: 'Use gcloud CLI' + run: 'gcloud info' \ No newline at end of file From 87f1ababab53ca4cd8b65a66a4734a00c05366f5 Mon Sep 17 00:00:00 2001 From: Reinaldo Costa Date: Tue, 2 Apr 2024 11:16:59 -0300 Subject: [PATCH 2/5] chore: add test workflow --- .github/workflows/tt.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tt.yaml b/.github/workflows/tt.yaml index dadbfdc..c9b273a 100644 --- a/.github/workflows/tt.yaml +++ b/.github/workflows/tt.yaml @@ -14,6 +14,10 @@ jobs: id-token: 'write' steps: + + - name: Check out Git repository + uses: actions/checkout@v3 + - id: 'auth' uses: 'google-github-actions/auth@v2' with: @@ -26,4 +30,8 @@ jobs: version: '>= 363.0.0' - name: 'Use gcloud CLI' - run: 'gcloud info' \ No newline at end of file + run: 'gcloud info' + + # Build and push image to Google Container Registry + - name: Build + run: gcloud builds submit --tag us-central1-docker.pkg.dev/gtp-reinaldo-study-0001/default-repo/sample:tag1 From a1578a7ea369a97a4b60c5c82cec044b274af527 Mon Sep 17 00:00:00 2001 From: Reinaldo Costa Date: Tue, 2 Apr 2024 12:37:21 -0300 Subject: [PATCH 3/5] chore: change provider --- .github/workflows/tt.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tt.yaml b/.github/workflows/tt.yaml index c9b273a..7795865 100644 --- a/.github/workflows/tt.yaml +++ b/.github/workflows/tt.yaml @@ -21,8 +21,8 @@ jobs: - id: 'auth' uses: 'google-github-actions/auth@v2' with: - workload_identity_provider: 'projects/195139564832/locations/global/workloadIdentityPools/my-pool/providers/my-provider' - service_account: 'action-deployer@gtp-reinaldo-study-0001.iam.gserviceaccount.com' + workload_identity_provider: 'projects/195139564832/locations/global/workloadIdentityPools/github-wif-pool/providers/githubwif' + service_account: 'wif-deployer@gtp-reinaldo-study-0001.iam.gserviceaccount.com' - name: 'Set up Cloud SDK' uses: 'google-github-actions/setup-gcloud@v2' From a49cbbcd4e88644a688592ea9e757eb325b97f0e Mon Sep 17 00:00:00 2001 From: Reinaldo Costa Date: Tue, 2 Apr 2024 13:42:50 -0300 Subject: [PATCH 4/5] chore: add instructions --- .github/workflows/tt.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tt.yaml b/.github/workflows/tt.yaml index 7795865..f3af2d0 100644 --- a/.github/workflows/tt.yaml +++ b/.github/workflows/tt.yaml @@ -21,8 +21,8 @@ jobs: - id: 'auth' uses: 'google-github-actions/auth@v2' with: - workload_identity_provider: 'projects/195139564832/locations/global/workloadIdentityPools/github-wif-pool/providers/githubwif' - service_account: 'wif-deployer@gtp-reinaldo-study-0001.iam.gserviceaccount.com' + workload_identity_provider: 'projects/195139564832/locations/global/workloadIdentityPools/github-pool/providers/github-wif' + service_account: 'github-action-deployer@gtp-reinaldo-study-0001.iam.gserviceaccount.com' - name: 'Set up Cloud SDK' uses: 'google-github-actions/setup-gcloud@v2' From 690bf9a9689620dd87ef2b3d4ff67e6ab96e6c95 Mon Sep 17 00:00:00 2001 From: Reinaldo Costa Date: Tue, 2 Apr 2024 13:57:26 -0300 Subject: [PATCH 5/5] chore: workflow values --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 750bdec..dc6b806 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -12,6 +12,6 @@ jobs: contents: read uses: gentrop-cloud/actions_workflows/.github/workflows/deploy.yaml@main with: - identity_pool: 'projects/195139564832/locations/global/workloadIdentityPools/my-pool/providers/my-provider' - identity_sa: 'action-deployer@gtp-reinaldo-study-0001.iam.gserviceaccount.com' + identity_pool: 'projects/195139564832/locations/global/workloadIdentityPools/github-pool/providers/github-wif' + identity_sa: 'github-action-deployer@gtp-reinaldo-study-0001.iam.gserviceaccount.com' image: 'us-central1-docker.pkg.dev/gtp-reinaldo-study-0001/default-repo/sample:tag1'