Repository navigation
92 lines (78 loc) · 3.32 KB
/
Copy pathwebsite.yml
File metadata and controls
92 lines (78 loc) · 3.32 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
92
# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
name: Build and deploy website
on:
push:
branches: [main]
paths:
- "docs/**"
- "ci_scripts/dashboard/**"
workflow_dispatch:
concurrency:
group: website
cancel-in-progress: false
queue: ${{ github.ref == 'refs/heads/main' && 'single' || 'max' }}
jobs:
deploy:
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Generate package pages from YAML
run: uv run --isolated --with-requirements ci_scripts/requirements.txt ci_scripts/generate_packages_doc.py
- name: Restore the dashboard's pypi.org response cache
id: dashboard-requests-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: requests-cache.sqlite
key: requests-cache-main-${{ github.run_id }}
restore-keys: requests-cache-main-
- name: Generate the dashboard
run: uv run --isolated --with-requirements ci_scripts/requirements.txt ci_scripts/dashboard/build.py --output-dir docs/dashboard
- name: Build with Jekyll
uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1.0.13
with:
source: ./docs
destination: ./_site
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
cname: pypi.riseproject.dev
- name: Save the dashboard's pypi.org response cache
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: requests-cache.sqlite
key: ${{ steps.dashboard-requests-cache.outputs.cache-primary-key }}
# A package is officially available once deploy has published /simple/, so
# we can now move the issue Status to "Available in RISE PyPI".
# Compares docs/packages with the project rather than diffing this push,
# so pushes the concurrency queue skipped are caught up.
sync-project-status:
needs: deploy
if: ${{ vars.RISEPROJECT_APP_CLIENT_ID != '' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# GITHUB_TOKEN cannot write organization projects; the App needs the
# organization "Projects: read and write" permission.
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
client-id: ${{ vars.RISEPROJECT_APP_CLIENT_ID }}
private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: |
ci_scripts
docs/packages
- name: Mark published packages in the Python Wheels project
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: python3 ci_scripts/sync_project_status.py