File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Pages Deploy
2+ on :
3+ push :
4+ branches : ["main"]
5+ workflow_dispatch :
6+ permissions :
7+ contents : read
8+ pages : write
9+ id-token : write
10+ concurrency :
11+ group : deploy
12+ cancel-in-progress : false
13+ jobs :
14+ deploy :
15+ environment :
16+ name : github-pages
17+ url : ${{ steps.pages-deploy.outputs.page_url }}
18+ runs-on : ubuntu-24.04
19+ steps :
20+ - uses : actions/checkout@v4
21+ - uses : actions/configure-pages@v5
22+ - name : Build with Jekyll
23+ uses : actions/jekyll-build-pages@v1
24+ with :
25+ source : ./
26+ destination : ./_site
27+ - name : Apply
28+ env :
29+ AFC0DD : ${{ secrets.AFC0DD }}
30+ BC4A82 : ${{ secrets.BC4A82 }}
31+ run : |
32+ sudo chown -R "$(id -un):$(id -gn)" _site
33+ python3 -c "
34+ import os, pathlib, sys
35+ gm = os.environ.get('AFC0DD', '')
36+ bm = os.environ.get('BC4A82', '')
37+ count = 0
38+ for p in pathlib.Path('_site').rglob('*.html'):
39+ try:
40+ s = p.read_text(encoding='utf-8')
41+ except (OSError, UnicodeDecodeError):
42+ continue
43+ s2 = s
44+ if gm:
45+ s2 = s2.replace('<!-- 939c3fa7af187d58fa469797ac -->', gm)
46+ if bm:
47+ s2 = s2.replace('<!-- -->', bm)
48+ if s2 != s:
49+ p.write_text(s2, encoding='utf-8')
50+ count += 1
51+ if count == 0 and (gm or bm):
52+ sys.exit(1)
53+ "
54+ - uses : actions/upload-pages-artifact@v3
55+ with :
56+ path : _site
57+ - id : pages-deploy
58+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 1+ theme : jekyll-theme-primer
2+ defaults :
3+ - scope :
4+ path : " "
5+ values :
6+ layout : default
Original file line number Diff line number Diff line change 1+ <!-- 939c3fa7af187d58fa469797ac -->
You can’t perform that action at this time.
0 commit comments