Update VEX Hub #125
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
| name: Update VEX Hub | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # Every day | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| actions: read | |
| jobs: | |
| update: | |
| name: Update VEX Hub | |
| runs-on: ubuntu-24.04 | |
| env: | |
| VEXHUB_CRAWLER_COMMIT: "691c2aaad9e15493af3416edb96b787e954ef1f7" | |
| steps: | |
| - name: Check out vexhub repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: vexhub | |
| - name: Check out vexhub-crawler | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ github.repository_owner }}/vexhub-crawler | |
| ref: ${{ env.VEXHUB_CRAWLER_COMMIT }} | |
| path: vexhub-crawler | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: vexhub-crawler/go.mod | |
| - name: Set up git user | |
| run: | | |
| git config --global user.email "action@github.com" | |
| git config --global user.name "GitHub Action" | |
| - name: Build vexhub-crawler | |
| run: | | |
| cd vexhub-crawler | |
| go install . | |
| cd .. | |
| - name: Run vexhub-crawler | |
| run: | | |
| vexhub-crawler --config ./vexhub-crawler/crawler.yaml --vexhub-dir ./vexhub | |
| - name: Commit and push changes | |
| run: | | |
| cd vexhub | |
| if [[ -n $(git status --porcelain) ]]; then | |
| git add . | |
| git commit -m "Update VEX documents" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi |