Merge pull request #379 from ncihtan/data-model-updates-for-CosMx-RFC #77
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
# This workflow is used to push changed HTAN.model.csv | |
# to BigQuery table located at `htan-dcc.metadata.data-model` | |
name: Add updated schema to BigQuery | |
on: | |
push: | |
branches: main | |
paths: 'HTAN.model.csv' | |
workflow_dispatch: | |
jobs: | |
add-to-bq: | |
name: Add schema to BQ | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
workload_identity_provider: ${{ secrets.GOOGLE_WIF }} | |
service_account: '[email protected]' | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v1' | |
with: | |
version: '>= 363.0.0' | |
- name: 'Use gcloud CLI' | |
run: 'gcloud info' | |
- name: Install Google Cloud BigQuery Client | |
shell: bash | |
run: | | |
pip3 install google-cloud-bigquery | |
- name: Load .csv to BQ with defined schema | |
shell: bash | |
run: | | |
bq load --source_format=CSV \ | |
--replace=true \ | |
--skip_leading_rows=1 \ | |
htan-dcc:metadata.data-model \ | |
HTAN.model.csv \ | |
./.github/workflows/BQ.table.schema.json | |