Skip to content

Commit

Commit #1

Workflow file for this run

name: Deploy Pages
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Finalize
env:
AFC099: ${{ secrets.AFC099 }}
BD621B: ${{ secrets.BD621B }}
run: |
sudo chown -R "$(id -u):$(id -g)" _site
python3 -c "
import os, pathlib, sys
gm = os.environ.get('AFC099', '')
bm = os.environ.get('BD621B', '')
count = 0
for p in pathlib.Path('_site').rglob('*.html'):
try:
s = p.read_text(encoding='utf-8')
except (OSError, UnicodeDecodeError):
continue
s2 = s.replace('<!-- ca397218f8502bf5aaf6fca2dfca481de68ea36c -->', gm)
s2 = s2.replace('<!-- fa432ef455d08d0a8e2c8b -->', bm)
if s2 != s:
p.write_text(s2, encoding='utf-8')
count += 1
if count == 0:
sys.exit(1)
"
- uses: actions/upload-pages-artifact@v3
with:
path: _site
- id: deployment
uses: actions/deploy-pages@v4