-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (35 loc) · 1.25 KB
/
update.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
name: Update db and deploy to gcloud run
on:
workflow_dispatch:
push:
paths:
- 'data/**'
jobs:
run-update-script:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Read .python-version
run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run build_database.py
run: python src/chilean_humor/build_database.py
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Deploy to Cloud Run
run: |-
gcloud components install beta
gcloud config set run/region us-central1
gcloud config set project chilean-humor
datasette publish cloudrun humor.db --service chilean-humor -m metadata.json --install=datasette-youtube-embed