-
-
Notifications
You must be signed in to change notification settings - Fork 89
69 lines (66 loc) · 2.16 KB
/
table-approve.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: table-approve
on:
push:
branches:
- master
- fix-table-approve-metadata-publish-2
- mfagundes-patch-1
workflow_dispatch:
jobs:
get-changes:
runs-on: ubuntu-latest
steps:
- name: Check file changes
id: file_changes
uses: trilom/[email protected]
- name: Copy file changes
run: cp $HOME/files.json files.json
- name: Upload file changes
uses: actions/upload-artifact@v2
with:
name: push-changes
path: files.json
table-approve:
needs: get-changes
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Download changes
uses: actions/download-artifact@v2
with:
name: push-changes
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install basedosdados==1.6.9 toml
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_MAIN_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY_TASK_CALLER }}
export_default_credentials: true
- name: Set up base dos dados environment
run: python .github/workflows/env-setup/env_setup.py
shell: bash
env:
BUCKET_NAME: basedosdados
PROJECT_NAME_PROD: basedosdados
PROJECT_NAME_STAGING: basedosdados-staging
GCP_BD_PROD: ${{ secrets.GCP_TABLE_APPROVE_PROD }}
GCP_BD_STAGING: ${{ secrets.GCP_TABLE_APPROVE_STAGING }}
CKAN_URL: "https://basedosdados.org"
CKAN_API_KEY: ${{ secrets.CKAN_PROD }}
- name: Table approve
run: python -u .github/workflows/table-approve/table_approve.py
shell: bash
env:
PROJECT_ID: ${{ secrets.GCP_MAIN_PROJECT_ID }}
BUCKET_NAME_BACKUP: basedosdados-backup
BUCKET_NAME_DESTINATION: basedosdados
# Reference
# https://github.com/google-github-actions/setup-gcloud/blob/master/setup-gcloud/README.md