Build Yubenbango #36
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: Build Yubenbango | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # * is a special character in YAML, so you have to quote this string | |
| - cron: '0 0 1 * *' # run job on the first day of every month | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| change_detected: ${{ steps.commit_and_push.outputs.change_detected }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| cache: 'pip' | |
| - run: pip install -r requirements.txt | |
| - run: make all | |
| - run: zip -r data/yubenbango.zip data/yubenbango.sqlite | |
| - name: Commit and push if zip codes changed | |
| id: commit_and_push | |
| run: | | |
| git config user.name "Automated" | |
| git config user.email "actions@users.noreply.github.com" | |
| git add -A | |
| timestamp=$(date -u) | |
| git commit -m "Jurisdictions and postal codes updated on ${timestamp}" || exit 0 | |
| git push | |
| echo "::set-output name=change_detected::1" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: yubenbango_sqlite_db | |
| path: data/yubenbango.zip |