Update NVC data #3803
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 NVC data | |
on: | |
schedule: | |
# check every 10 minutes on Monday in the update window | |
- cron: 3/10 14-16 * * 1 | |
# check every hour on Monday outside the update window | |
- cron: 38 0-13,17-23 * * 1 | |
# check every day for the rest of the week | |
- cron: 38 8 * * 0,2-6 | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: data/nvc | |
jobs: | |
update-nvc-data: | |
name: Update NVC data | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
new-commit-sha: ${{ steps.head_commit.outputs.commit_sha }} | |
updated: ${{ steps.commit.outputs.pushed }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Set up poetry | |
run: pipx install poetry | |
- name: Cache poetry virtualenv | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-data-nvc-${{ hashFiles('data/nvc/poetry.lock') }} | |
- name: Install dependencies | |
run: poetry install | |
- name: Run script | |
run: poetry run python main.py | |
- name: Commit changes | |
id: commit | |
uses: EndBug/add-and-commit@v9 | |
- id: head_commit | |
run: echo "::set-output name=commit_sha::$(git rev-parse HEAD)" | |
build: | |
if: needs.update-nvc-data.outputs.updated == 'true' | |
uses: underyx/visawhen/.github/workflows/build.yml@main | |
needs: [update-nvc-data] | |
with: | |
ref: ${{ needs.update-nvc-data.outputs.new-commit-sha }} | |
deploy: | |
uses: underyx/visawhen/.github/workflows/deploy.yml@main | |
needs: [build] | |
secrets: | |
netlify-token: ${{ secrets.NETLIFY_AUTH_TOKEN }} |