mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-07 04:42:43 +08:00
* ci: upgrade GitHub Actions to support Node.js 24 - pnpm/action-setup: v4 → v5 - actions/upload-artifact: v4 → v6 - actions/download-artifact: v4 → v6 - sync.yaml: replace inactive aormsby/Fork-Sync-With-Upstream-action with gh repo sync Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: replace softprops/action-gh-release with gh release CLI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): use gh release upload instead of create for existing releases Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
name: Deploy Frontend with page function
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: [Upstream Sync]
|
|
types: [completed]
|
|
push:
|
|
tags:
|
|
- "*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
has_config: ${{ steps.check.outputs.has_config }}
|
|
steps:
|
|
- name: Check PAGE_TOML
|
|
id: check
|
|
run: |
|
|
if [ -n "$PAGE_TOML" ]; then
|
|
echo "has_config=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "has_config=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
env:
|
|
PAGE_TOML: ${{ secrets.PAGE_TOML }}
|
|
|
|
deploy:
|
|
needs: check
|
|
if: ${{ needs.check.outputs.has_config == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
|
|
- uses: pnpm/action-setup@v5
|
|
name: Install pnpm
|
|
with:
|
|
version: 10
|
|
run_install: false
|
|
|
|
- name: Deploy Frontend for ${{ github.ref_name }}
|
|
run: |
|
|
cd frontend/
|
|
pnpm install --no-frozen-lockfile
|
|
pnpm build:pages
|
|
cd ../pages/
|
|
echo '${{ secrets.PAGE_TOML }}' > wrangler.toml
|
|
pnpm install --no-frozen-lockfile
|
|
pnpm run deploy
|
|
echo "Deploying production for ${{ github.ref_name }}"
|
|
env:
|
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|