Auto update #1016
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: Auto update | |
on: | |
push: | |
branches: [main] | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
cache/Tectonic/* | |
!cache/Tectonic/formats | |
key: tectonic-cache-${{ github.sha }} | |
restore-keys: | | |
tectonic-cache- | |
- name: Install pandoc | |
run: | | |
curl -L -s https://github.com/jgm/pandoc/releases/download/$PANDOC_VERSION/pandoc-$PANDOC_VERSION-linux-amd64.tar.gz \ | |
| sudo tar xvz --strip-components=2 -C /usr/local/bin pandoc-$PANDOC_VERSION/bin/pandoc | |
env: | |
PANDOC_VERSION: 3.1 | |
- name: Install ADS API | |
run: python -m pip install ads | |
- name: Update publication list | |
run: make | |
env: | |
ADS_DEV_KEY: ${{secrets.ADS_DEV_KEY}} | |
GITHUB_API_KEY: ${{secrets.GITHUB_TOKEN}} | |
- name: Push updated data files | |
continue-on-error: true | |
run: | | |
git add . | |
git -c user.name='gh-actions' -c user.email='gh-actions' commit -m "updating data" | |
git push https://github.com/$GITHUB_REPOSITORY | |
- name: Install tectonic | |
uses: wtfjoke/setup-tectonic@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Compile | |
run: | | |
./scripts/compile | |
mkdir -p results | |
cp tex/*.pdf results | |
env: | |
XDG_CACHE_HOME: cache | |
- name: Push documents | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: results | |
target-folder: tex | |
branch: main-pdf | |
commit-message: "updating pdfs" | |
clean: true | |
single-commit: true |