Created
March 21, 2023 10:08
-
-
Save niczky12/d3dd545361bf9aa6195511c546cbd0c5 to your computer and use it in GitHub Desktop.
deploying bigquery functions via github actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
env: | |
GCP_PROJECT_ID: your_project_id | |
BQ_DATASET_ID: your_dataset_id | |
jobs: | |
deploy-custom-functions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v1' | |
- name: Deploy BigQuery custom functions | |
run: | | |
for function in custom_functions/*; do | |
bq --project_id $GCP_PROJECT_ID --dataset_id $BQ_DATASET_ID query --nouse_legacy_sql "$(cat $function)" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment