Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: move values to repo env #132

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
16 changes: 10 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z0-9]+)?"

permissions:
souzamari marked this conversation as resolved.
Show resolved Hide resolved
contents: read
id-token: write

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can put the value directly here as the workload_identity_provider is not sensitive.

service-account: ${{ secrets.SERVICE_ACCOUNT }}

jobs:
tests-prettier:
Expand Down Expand Up @@ -93,8 +97,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 +143,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