Files
homepage/.gitea/workflows/deploy-lan.yml
dafe 0273888747 feat: Phase 0 技术性 SEO+GEO
- 新增 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 清单补入三个根文件
2026-11-09 15:08:23 +08:00

38 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: 部署-局域网
# 合并/推送到 main 即自动上线 51.66(集成分支 = 内部预发布环境)
# feature 分支的 push 不触发,开发期不影响线上
on:
push:
branches: [main]
jobs:
deploy:
runs-on: build-runner
steps:
- name: 拉取代码
run: |
git clone --depth 1 --branch "${GITHUB_REF_NAME}" "http://dafe:${{ secrets.GITHUB_TOKEN }}@192.168.51.66:3000/dafe/homepage.git" site
- name: 注入构建版本号(缓存击穿,版本=commit 短 SHA)
run: |
cd site
sed -i "s/?v=[0-9]*/?v=${GITHUB_SHA:0:8}/g" index.html
- name: 部署到 51.66
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 192.168.51.66 >> ~/.ssh/known_hosts 2>/dev/null
cd site
# 清空后解压 = rsync --delete 的等效语义,服务器与 git 状态严格一致
ssh ubuntu@192.168.51.66 'mkdir -p /home/ubuntu/homepage-site && find /home/ubuntu/homepage-site -mindepth 1 -maxdepth 1 -exec rm -rf {} +'
tar czf - index.html assets robots.txt sitemap.xml llms.txt | ssh ubuntu@192.168.51.66 'tar xzf - -C /home/ubuntu/homepage-site'
- name: 上线验证
run: |
curl -sk -f -o /dev/null https://192.168.51.66/homepage/ || { echo "❌ 局域网验证失败"; exit 1; }
echo "✅ 局域网已上线 $(date '+%H:%M:%S')"