Pull Metadata #122
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
# This is a basic workflow to help you get started with Actions | |
name: Pull Metadata | |
# Controls when the workflow will run | |
on: | |
schedule: | |
# Run every Monday | |
- cron: '0 0 * * MON' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. | |
contents: write | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
# Runs a single command using the runners shell | |
- name: install-nuldc | |
run: pip install nuldc | |
# Runs a set of commands using the runners shell | |
- name: run-nuldc | |
run: cd data && nuldump | |
# zip the files to keep them smallish force update of existing | |
- name: gzip-up | |
run: | | |
for format in csv json xml; do | |
gzip -fv data/$format/*.$format || true | |
done | |
# commit upstream | |
- name: push | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "Update metadata as of $(date +%Y-%m-%d)" | |
git push origin main | |