- 新增 robots.txt(显式欢迎 AI 爬虫)/ sitemap.xml / llms.txt - head:TKD 重写(关键词式 title)、canonical、og:url/og:locale、og:image 改绝对地址 - JSON-LD:Organization + 8 产品 + FAQPage 三组 - 新增 FAQ 区块(原生 details 手风琴,零 JS)+ i18n 13 键 - 8 产品图 alt 补型号关键词;双语言 document.title 同步 - CI:两条流水线 tar 清单补入三个根文件
37 lines
1.5 KiB
YAML
37 lines
1.5 KiB
YAML
name: 发布-云端
|
||
# 审核 = 人工决定打不打 tag:push v* 标签即发布公网
|
||
# 发布历史 = git tag 列表(git tag -l 'v*'),发布版本号 = tag 名
|
||
on:
|
||
push:
|
||
tags: ['v*']
|
||
|
||
jobs:
|
||
deploy:
|
||
runs-on: build-runner
|
||
steps:
|
||
- name: 拉取代码(tag 版本)
|
||
run: |
|
||
git clone --depth 1 --branch "${GITHUB_REF_NAME}" "http://dafe:${{ secrets.GITHUB_TOKEN }}@192.168.51.66:3000/dafe/homepage.git" site
|
||
|
||
- name: 注入发布版本号(缓存击穿,版本=tag 名)
|
||
run: |
|
||
cd site
|
||
sed -i "s/?v=[0-9]*/?v=${GITHUB_REF_NAME}/g" index.html
|
||
|
||
- name: 发布到 ubuntu3(公网 www.shashann.com)
|
||
env:
|
||
DEPLOY_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||
run: |
|
||
mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
||
printf '%s\n' "$DEPLOY_KEY" > ~/.ssh/id_ed25519
|
||
chmod 600 ~/.ssh/id_ed25519
|
||
ssh-keyscan -H 124.222.157.76 >> ~/.ssh/known_hosts 2>/dev/null
|
||
cd site
|
||
ssh ubuntu@124.222.157.76 'mkdir -p /var/www/shashann-homepage && find /var/www/shashann-homepage -mindepth 1 -maxdepth 1 -exec rm -rf {} +'
|
||
tar czf - index.html assets robots.txt sitemap.xml llms.txt | ssh ubuntu@124.222.157.76 'tar xzf - -C /var/www/shashann-homepage'
|
||
|
||
- name: 上线验证
|
||
run: |
|
||
curl -s -f -o /dev/null --resolve www.shashann.com:443:124.222.157.76 https://www.shashann.com/ || { echo "❌ 公网验证失败"; exit 1; }
|
||
echo "✅ 云端已发布 ${GITHUB_REF_NAME} $(date '+%H:%M:%S')"
|