68 lines (61 loc) · 2.5 KB
/
build.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
# This is a basic workflow to help you get started with Actions
name: Update Database
concurrency:
group: database-build
# Controls when the action will run.
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '11 05 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# Add "id-token" with the intended permissions.
permissions:
contents: 'read'
id-token: 'write'
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
workload_identity_provider: 'projects/450850437809/locations/global/workloadIdentityPools/gh-pool/providers/gh-provider'
service_account: 'github-deploy-labordata@labordata.iam.gserviceaccount.com'
- name: Set up Cloud Run
uses: google-github-actions/setup-gcloud@v0
- name: set longer cloud build timeout
run: |
gcloud config set builds/timeout 1800
gcloud config get builds/timeout
- name: dependencies
run: pip install -r requirements.txt
- name: get databases
run: make -j 4
- name: Deploy to Cloudrun
run: |
gcloud config set run/region us-central1
gcloud config set project labordata
datasette publish cloudrun *.db \
--memory 8Gi \
--cpu 2 \
--max-instances=2 \
--service warehouse \
-m warehouse_metadata.yml \
--template-dir=templates/ \
--extra-options="--crossdb --setting sql_time_limit_ms 100000 --cors --setting facet_time_limit_ms 500 --setting allow_facet off --setting trace_debug 1" \
--install=datasette-atom \
--install=datasette-rure \
--install=pysqlite3-binary \
--install=datasette-hashed-urls \
--install=datasette-block-robots \
--install=datasette-pretty-traces \
--version-note=$GITHUB_RUN_NUMBER
- name: keepalive
uses: gautamkrishnar/keepalive-workflow@v1