Repository navigation
82 lines (68 loc) · 1.88 KB
/
Copy pathdeploy-pages.yml
File metadata and controls
82 lines (68 loc) · 1.88 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
name: Deploy GitHub Pages
on:
push:
branches:
- main
paths-ignore:
- README.md
- "*/README.md"
- "*/_summary.md"
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: github-pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install uv
run: python -m pip install uv
- name: Update README with cogapp
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: uv run --with-requirements requirements.txt cog -r -P README.md
- name: Commit README updates
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add README.md
git add */README.md 2>/dev/null || true
git add */_summary.md 2>/dev/null || true
if git diff --staged --quiet; then
echo "No README updates to commit"
else
git commit -m "Auto-update README with cogapp"
git push
fi
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Build site
env:
GITHUB_TOKEN: ${{ github.token }}
run: bash ./build-github-pages.sh
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4