-
Notifications
You must be signed in to change notification settings - Fork 27.4k
80 lines (67 loc) · 1.86 KB
/
deploy-website.yml
File metadata and controls
80 lines (67 loc) · 1.86 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
name: Deploy Website
on:
push:
branches:
- master
schedule:
- cron: "0 0 * * *"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install dependencies
run: uv sync --group build
- name: Restore star data cache
id: cache-stars
uses: actions/cache/restore@v4
with:
path: website/data/github_stars.json
key: github-stars-${{ github.run_id }}
restore-keys: github-stars-
- name: Fetch GitHub stars
id: fetch-stars
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make fetch_github_stars
- name: Save star data cache
if: steps.fetch-stars.outcome == 'success'
uses: actions/cache/save@v4
with:
path: website/data/github_stars.json
key: github-stars-${{ github.run_id }}
- name: Verify star data exists
run: |
if [ ! -f website/data/github_stars.json ]; then
echo "::error::github_stars.json not found. No cache and fetch failed or was skipped."
exit 1
fi
echo "Star data found: $(wc -l < website/data/github_stars.json) lines"
- name: Build site
run: make build
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: website/output/
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: https://awesome-python.com/
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4