Update submodules #774
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: Update submodules | |
on: workflow_dispatch | |
jobs: | |
publish_job: | |
runs-on: ubuntu-latest | |
name: Pull and update submodules | |
steps: | |
- name: Checkout contents repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.DWARVES_PAT }} | |
submodules: recursive | |
fetch-depth: 5 | |
- name: Install devbox | |
uses: jetpack-io/devbox-install-action@v0.11.0 | |
with: | |
enable-cache: true | |
devbox-version: 0.12.0 | |
- name: Pull & update submodules recursively | |
run: | | |
yes | git submodule update --init --recursive --remote --progress --merge --filter=blob:none | |
git submodule foreach --recursive 'branch=$(git rev-parse --abbrev-ref HEAD); if [ "$(git config --get branch.$branch.remote)" = "" ]; then git checkout $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo main); fi' | |
- name: Export DB | |
shell: bash | |
run: | | |
git config --global user.email "actions@github.com" | |
git config --global user.name "GitHub Actions" | |
devbox run duckdb-export | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
INFINITY_API_KEY: ${{ secrets.INFINITY_API_KEY }} | |
INFINITY_OPENAI_BASE_URL: ${{ secrets.INFINITY_OPENAI_BASE_URL }} | |
JINA_API_KEY: ${{ secrets.JINA_API_KEY }} | |
JINA_BASE_URL: ${{ secrets.JINA_BASE_URL }} | |
- name: Commit and push changes | |
run: | | |
git config --global user.email "actions@github.com" | |
git config --global user.name "GitHub Actions" | |
git submodule foreach --recursive "git add --all; git commit -m 'chore(ci): update submodule' || echo 'No changes committed'; git push" | |
git add --all | |
git commit -m "chore(ci): update submodules and reindex" || echo "No changes committed" | |
git push |