Repository navigation
91 lines (76 loc) · 2 KB
/
Copy pathwebsite.yaml
File metadata and controls
91 lines (76 loc) · 2 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
79
80
81
82
83
84
85
86
87
88
89
90
91
name: website
on:
push:
branches: [main]
pull_request:
release:
types: [published]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: quarto-dev/quarto-actions/setup@v2
# Setting up the environment
- name: Setup Pages
uses: actions/configure-pages@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --all-extras
# Building
- name: Build HTML using uv
run: |
uv run make docs
# Upload
- name: Upload artifacts
uses: actions/upload-pages-artifact@v5
with:
name: github-pages
retention-days: 7
path: site/
deploy:
# Deploy to the github-pages environment
# but not on PRs
if: ${{ github.event_name != 'pull_request' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
with:
artifact_name: github-pages
preview: true
post-page-artifact:
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Post comment preview
uses: CDCgov/cfa-actions/post-artifact@v1.7.0
with:
artifact-name: github-pages
gh-token: ${{ secrets.GITHUB_TOKEN}}