Deploy View
π <ENV> - [BigQuery] Deploy viewβ
This GitHub Actions workflow allows developers to manually deploy a BigQuery view by executing a TypeScript script. It authenticates using a service account and triggers the view deployment logic.
π Workflow Triggerβ
This workflow is triggered manually via the GitHub actions in function repo
Required Input:β
view_name(string): The name of the view to be deployed.
π Environment Variablesβ
| Variable | Description |
|---|---|
GCP_PROJECT_ID | GCP Project ID (e.g., biddirect-2) |
π Job: deploy-bigquery-viewβ
| Step | Description |
|---|---|
| Checkout repository | Clones the repository to the runner. |
| Set project env variable | Adds GCP_PROJECT_ID to GitHub environment variables. |
| Authenticate with GCP | Authenticates using a service account (<ENV>_BIGQUERY_ADMIN_SERVICE_ACCOUNT) stored in GitHub Secrets. |
| Set up Cloud SDK | Installs and configures the Google Cloud CLI. |
| Install dependencies | Runs npm install inside the functions directory. |
| Deploy BigQuery view | Executes the specified TypeScript file using ts-node. |
π§Ή View Script Locationβ
All view definitions should be located at:
functions/src/bqDataLake/definitions/views/
The input view_name should match the file name (without .ts).
Example:
functions/src/bqDataLake/definitions/views/accounts_latest_view.ts
To deploy: use accounts_latest_view as the input.
π Required Secretsβ
| Secret Name | Description |
|---|---|
<ENV>_BIGQUERY_ADMIN_SERVICE_ACCOUNT | Service account key JSON for GCP auth. |
β Example Usageβ
To run this workflow:
- Go to the Actions tab in your GitHub repository.
- Select the workflow
<ENV> - [BigQuery] Deploy view. - Click "Run workflow".
- Enter the
view_name(e.g.,accounts_latest_view). - Click "Run workflow".
This will execute:
npx ts-node functions/src/bqDataLake/definitions/views/accounts_latest_view.ts
and deploy the BigQuery view as defined in the script.