Upload duckdb database to Motherduck #1
This file contains 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
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 }} |