Update consulates data #1171
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 consulates data | |
on: | |
schedule: | |
# check every day | |
- cron: 19 14 * * * | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: data/consulates | |
permissions: | |
contents: write | |
jobs: | |
update-consulates-data: | |
name: Update consulates data | |
runs-on: ubuntu-latest | |
outputs: | |
new-commit-sha: ${{ steps.head_commit.outputs.commit_sha }} | |
updated: ${{ steps.commit.outputs.pushed }} | |
permissions: | |
contents: write | |
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/[email protected] | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-data-consulates-${{ hashFiles('data/consulates/poetry.lock') }} | |
- name: Cache joblib results | |
uses: actions/[email protected] | |
with: | |
path: .joblib-cache/ | |
key: ${{ runner.os }}-consulates-joblib-results | |
- name: Install required C libraries | |
run: | | |
apt-fast update | |
apt-fast install -y --no-install-recommends ghostscript libxml2-dev libxslt1-dev | |
- name: Install dependencies | |
run: poetry install | |
- name: Run script | |
run: poetry run jupyter nbconvert --to notebook --execute visa-issuances.ipynb | |
- name: Run other script | |
run: poetry run jupyter nbconvert --to notebook --execute baselines.ipynb | |
- 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-consulates-data.outputs.updated == 'true' | |
uses: underyx/visawhen/.github/workflows/build.yml@main | |
needs: [update-consulates-data] | |
with: | |
ref: ${{ needs.update-consulates-data.outputs.new-commit-sha }} | |
deploy: | |
uses: underyx/visawhen/.github/workflows/deploy.yml@main | |
needs: [build] | |
secrets: | |
netlify-token: ${{ secrets.NETLIFY_AUTH_TOKEN }} |