Update Travis CI links #109
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 website | |
# Update on every push | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 11 4 * *' | |
jobs: | |
build: | |
name: Update website | |
runs-on: ubuntu-latest | |
steps: | |
# check-out this repository | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Set up pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install LaTeX | |
shell: bash -l {0} | |
run: | | |
sudo paperconfig -p letter | |
sudo apt-get update -y | |
sudo apt-get install -y --no-install-recommends dvipng texlive-latex-base texlive-latex-extra texlive-fonts-recommended graphviz xzdec latexmk tex-gyre | |
- name: Install dependencies | |
shell: bash -l {0} | |
working-directory: notes | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# Check that all links work | |
- name: Check external links | |
shell: bash -l {0} | |
working-directory: notes | |
run: make linkcheck | |
# Build the website locally | |
- name: Build website | |
shell: bash -l {0} | |
working-directory: notes | |
run: make html | |
# Push to Amazon S3 | |
- name: Upload website | |
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | |
uses: jakejarvis/s3-sync-action@v0.5.1 | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: 'us-east-2' | |
SOURCE_DIR: 'notes/build/html' # optional: defaults to entire repository |