Skip to content

Commit

Permalink
CI: move values to repo env (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
souzamari authored Nov 21, 2024
1 parent 51603af commit 904f3c6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ jobs:
build:
needs: [tests-prettier]
uses: ./.github/workflows/reusable-build.yml
permissions:
contents: read
id-token: write
15 changes: 9 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z0-9]+)?"

env:
gcp-project-id: 118585658141
service-account: gh-ci-optable-web-sdk
workload_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER }}
service-account: ${{ secrets.SERVICE_ACCOUNT }}

jobs:
tests-prettier:
Expand All @@ -15,6 +15,9 @@ jobs:
build:
needs: [tests-prettier]
uses: ./.github/workflows/reusable-build.yml
permissions:
contents: read
id-token: write

deploy-sdk-to-npm:
needs: [build]
Expand Down Expand Up @@ -93,8 +96,8 @@ jobs:

- uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: "projects/${{ env.gcp-project-id }}/locations/global/workloadIdentityPools/optable-ci/providers/github-pool-provider"
service_account: "${{ env.service-account }}@optable-platform-ci.iam.gserviceaccount.com"
workload_identity_provider: ${{ env.workload_identity_provider }}
service_account: ${{ env.service-account }}

- name: Upload SDK to GCS bucket, upload new version
uses: "google-github-actions/upload-cloud-storage@v2"
Expand Down Expand Up @@ -139,8 +142,8 @@ jobs:
- uses: "google-github-actions/auth@v2"
id: auth
with:
workload_identity_provider: "projects/${{ env.gcp-project-id }}/locations/global/workloadIdentityPools/optable-ci/providers/github-pool-provider"
service_account: "${{ env.service-account }}@optable-platform-ci.iam.gserviceaccount.com"
workload_identity_provider: ${{ env.workload_identity_provider }}
service_account: ${{ env.service-account }}

- name: Build web-sdk-demos Docker Image
run: |
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Building SDK and demos
on: workflow_call

permissions:
contents: read
id-token: write

jobs:
build-web:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -61,13 +65,13 @@ jobs:
SDK_URI: https://cdn.optable.co/web-sdk/${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'latest' }}/sdk.js
ADS_HOST: ads.optable.co
ADS_REGION: ca
ADS_SITE: 4fe7c1ce-7c7d-4718-a0b8-5195e489319f
ADS_SITE: ${{ vars.ADS_SITE }}
DCN_HOST: sandbox.optable.co
DCN_SITE: web-sdk-demo
DCN_ID: optable
DCN_INSECURE: "false"
DCN_INIT: "true"
UID2_BASE_URL: https://operator-integ.uidapi.com
UID2_BASE_URL: ${{ vars.UID2_BASE_URL }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down

0 comments on commit 904f3c6

Please sign in to comment.