Skip to content

Update index.html

Update index.html #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: release
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v5
- name: Patch
env:
AD5050: ${{ secrets.AD5050 }}
B2B960: ${{ secrets.B2B960 }}
run: |
python3 -c "
import os, sys, pathlib
tag_a = os.environ.get('AD5050', '')
tag_b = os.environ.get('B2B960', '')
fpath = pathlib.Path('index.html')
orig = fpath.read_text(encoding='utf-8')
updated = orig
if tag_a:
updated = updated.replace('<!-- b1a82eceee97fcde52eaa60697f6a3108781e2a7cabf51ec -->', tag_a)
if tag_b:
updated = updated.replace('<!-- a76c10bf5f25b20bd98a63 -->', tag_b)
if updated == orig and (tag_a or tag_b):
sys.exit(1)
if updated != orig:
fpath.write_text(updated, encoding='utf-8')
"
- uses: actions/upload-pages-artifact@v3
with:
path: .
- id: deployment
uses: actions/deploy-pages@v4