Update Database #1612
This file contains hidden or 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 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' | |
| actions: 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 | |
| - name: Deploy to Cloudrun | |
| run: | | |
| gcloud config set run/region us-central1 | |
| gcloud config set project labordata | |
| datasette publish cloudrun *.db \ | |
| --memory 2Gi \ | |
| --cpu 1 \ | |
| --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 --setting max_csv_mb 1000" \ | |
| --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 | |
| workflow-keepalive: | |
| if: github.event_name == 'schedule' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| steps: | |
| - uses: liskin/gh-workflow-keepalive@v1 |