diff --git a/.github/workflows/deploy-landing.yml b/.github/workflows/deploy-landing.yml new file mode 100644 index 0000000..a3c34a1 --- /dev/null +++ b/.github/workflows/deploy-landing.yml @@ -0,0 +1,55 @@ +name: Deploy Landing + +# 自動部署 landing/ (Next.js on Cloudflare Pages) +# 觸發:push 到 main 且 landing/ 有變動,或手動 +# 為何獨立檔:landing 是 Pages 不是 Worker,跟 deploy.yml (掃 wrangler.toml) 邏輯不同 +# Secret 需要:CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID(既有) + +on: + push: + branches: [main] + paths: + - 'landing/**' + - '.github/workflows/deploy-landing.yml' + workflow_dispatch: + +concurrency: + group: deploy-landing-${{ github.ref }} + cancel-in-progress: false + +jobs: + deploy: + name: Build + Deploy to CF Pages + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + with: + version: 10 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install + working-directory: landing + run: pnpm install --no-frozen-lockfile + + - name: Build (Next.js) + working-directory: landing + run: pnpm next build + + - name: Build for Pages + working-directory: landing + run: pnpm exec next-on-pages + + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy landing/.vercel/output/static --project-name arcrun-landing --branch main --commit-message "ci ${{ github.sha }}"