Skip to content

Upload duckdb database to Motherduck #1

Upload duckdb database to Motherduck

Upload duckdb database to Motherduck #1

name: Upload duckdb database to Motherduck
on:
workflow_dispatch:
workflow_run:
workflows:
- Run dbt
types:
- completed
env:
DUCKDB_DATABASE: github_contributions
DUCKDB_PATH: github_contributions.duckdb
DUCKDB_VERSION: v0.8.1
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download duckdb
uses: dawidd6/action-download-artifact@v2
with:
name: ${{ env.DUCKDB_PATH }}
workflow: dbt.yml
workflow_conclusion: success
- uses: opt-nc/[email protected]
with:
version: ${{ env.DUCKDB_VERSION }}
- name: Upload duckdb database to Motherduck
run: |
duckdb -c ".open md:" -s "DROP DATABASE IF EXISTS ${{ env.DUCKDB_DATABASE }}"
duckdb -c ".open md:" -s "CREATE DATABASE ${{ env.DUCKDB_DATABASE }} FROM '${{ env.DUCKDB_PATH }}'"
env:
motherduck_token: ${{ secrets.MOTHERDUCK_TOKEN }}