deploy.cc自托管应用部署手册
deploy.cc / 配置生成

部署配置生成器

选择类型、填写参数,生成可直接使用的配置。生成结果在发布前经过 actionlint、hadolint、systemd-analyze 和 docker build 测试;Action 版本核对于 2026-11-13。

.github/workflows/deploy-github-pages.yml
# Build and publish to GitHub Pages (deploy.cc)
# Repo → Settings → Pages → Source: GitHub Actions
name: Deploy to GitHub Pages

on:
  push:
    branches: ['main']
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: pages
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: '24'
          cache: npm
      - name: Install dependencies
        run: npm ci
      - name: Build
        run: 'npm run build'
      - uses: actions/configure-pages@v6
      - uses: actions/upload-pages-artifact@v5
        with:
          path: 'dist'

  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - id: deployment
        uses: actions/deploy-pages@v5

输入只接受字母、数字和常见路径字符,不合法的值会回退到默认值。