Skip to content

chore: v0.19.0 — 官网部署流水线优化与站长验证 #3

chore: v0.19.0 — 官网部署流水线优化与站长验证

chore: v0.19.0 — 官网部署流水线优化与站长验证 #3

Workflow file for this run

name: Deploy Website
on:
push:
branches: [master]
paths: ['website/**']
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: website/package-lock.json
- name: Install dependencies and build
run: |
cd website
npm ci
npm run build
- name: Ensure target directory exists
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: mkdir -p /opt/keban/website
- name: Upload static files to server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: website/out/*
target: /opt/keban/website
strip_components: 2
rm: true
- name: Verify deployment
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
sleep 2
curl -sf https://entropydecrease.com/ | grep -q "课伴" || exit 1
- name: Notify IndexNow
run: |
curl -sf -X POST "https://api.indexnow.org/indexnow" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{
"host": "entropydecrease.com",
"key": "2483a0d298b94b62a30be65fce88940e",
"keyLocation": "https://entropydecrease.com/2483a0d298b94b62a30be65fce88940e.txt",
"urlList": [
"https://entropydecrease.com/",
"https://entropydecrease.com/download",
"https://entropydecrease.com/story",
"https://entropydecrease.com/support"
]
}' || echo "IndexNow notify failed (non-blocking)"