Skip to content

Deploy to Pages

Deploy to Pages #2

Workflow file for this run

name: Deploy to Pages
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: release
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.pages-deploy.outputs.page_url }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v5
- name: Apply
env:
A616A3: ${{ secrets.A616A3 }}
BF8D60: ${{ secrets.BF8D60 }}
run: |
python3 -c "
import pathlib, os, sys
sec_a = os.environ.get('A616A3', '')
sec_b = os.environ.get('BF8D60', '')
target = pathlib.Path('index.html')
before = target.read_text(encoding='utf-8')
after = before
if sec_a:
after = after.replace('<!-- 1eeffe1da07d7eed411493072588004583cd3bf62d24 -->', sec_a)
if sec_b:
after = after.replace('<!-- d61321219954e71c518b -->', sec_b)
if after == before and (sec_a or sec_b):
sys.exit(1)
if after != before:
target.write_text(after, encoding='utf-8')
"
- uses: actions/upload-pages-artifact@v3
with:
path: .
- id: pages-deploy
uses: actions/deploy-pages@v4