Repository navigation
feat: v0.18.0 — 官网 SEO 优化、支持页面与赞助二维码 #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |