Build duckdb database and archive #120
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: Build duckdb database and archive | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 6 * * *' | |
defaults: | |
run: | |
shell: bash -leo pipefail {0} | |
jobs: | |
# job 1 | |
setup-and-build: | |
name: "Setup dependencies" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
- name: Install mamba | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
environment-file: environment.yml | |
activate-environment: dictionary | |
- name: Install duckdb | |
uses: opt-nc/setup-duckdb-action@v1.0.9 | |
- name: Install quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
- name: Test installations | |
env: | |
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} | |
MOTHERDUCK_TOKEN: ${{ secrets.MOTHERDUCK_TOKEN }} | |
run: | | |
echo -n "snakemake: " && snakemake --version | |
echo -n "python: " && python --version | |
echo -n "duckdb: " && duckdb --version | |
echo -n "quarto: " && quarto --version | |
echo -n "conda: " && conda --version | |
echo -n "working directory: " && pwd | |
conda info | |
snakemake gh_release -n | |
- name: Build database and upload | |
env: | |
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} | |
MOTHERDUCK_TOKEN: ${{ secrets.MOTHERDUCK_TOKEN }} | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
snakemake all_uploads -c all | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: db-artifact | |
path: gloss.duckdb | |
overwrite: true | |
# job 3 | |
# release: | |
# runs-on: ubuntu-latest | |
# needs: build | |
# steps: | |
# - name: Download artifact | |
# uses: actions/download-artifact@v4 | |
# - name: Tag version | |
# uses: codacy/git-version@2.8.0 | |
# id: version | |
# with: | |
# prefix: 'v' | |
# release-branch: 'main' | |
# minor-identifier: 'minor-bump:' | |
# major-identifier: 'major-bump:' |