-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (45 loc) · 1.37 KB
/
schema-bq.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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