Update static assets #20
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 static assets | |
on: | |
push: | |
paths: | |
- '.github/workflows/update.yml' | |
workflow_dispatch: {} # Used to manually trigger a nightly build. | |
schedule: | |
# Run on 1st and 15th of each month | |
- cron: '1 2 1,15 * *' | |
permissions: | |
contents: write | |
env: | |
NODE_VERSION: '18' | |
jobs: | |
update: | |
name: Update static assets | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
with: | |
ref: develop | |
- name: Setup NodeJS ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'yarn' | |
# The scripts require some modules that we need to install. | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Config git | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
# Update CSL files | |
- name: Update CSL files | |
run: | | |
yarn update:csl | |
git add -A | |
git diff-index --quiet HEAD || git commit -m "chore(citeproc): Update CSL files" | |
# Update the CITATION.cff file if applicable | |
- name: Update CITATION.cff | |
run: | | |
yarn update:citation | |
git add -A | |
git diff-index --quiet HEAD || git commit -m "Update CITATION.cff" | |
# Test to make sure we don't break anything | |
- name: Test build | |
run: yarn test | |
- name: Push changes | |
uses: ad-m/github-push-action@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: develop |