Repository navigation
78 lines (62 loc) · 1.94 KB
/
Copy pathdeploy.yml
File metadata and controls
78 lines (62 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build and deploy site
on:
push:
branches:
- master
pull_request:
# Monthly redeploy: merges made by the Dependabot auto-merge workflow use
# GITHUB_TOKEN, which does not trigger the push event above.
schedule:
- cron: '0 6 3 * *'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version-file: '.python-version'
cache: 'pip'
- name: Install dependencies
run: python -m pip install -r requirements.txt
- name: Build site with Pelican
run: |
rm -rf _build
pelican content -s pelicanconf.py --fatal warnings
# Fails the build (and so blocks the deploy) if an internal link points
# at a missing file. Images hotlinked from evolution.berkeley.edu are
# checked separately in check-images.yml.
- name: Check internal links
run: python scripts/check_links.py _build
- name: Upload site artifact
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v5
with:
path: _build
deploy:
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Configure GitHub Pages
uses: actions/configure-pages@v6
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5