mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-06 20:32:55 +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>
65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
name: Deploy Docs
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- "vitepress-docs/**"
|
|
tags:
|
|
- "*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
|
|
- uses: pnpm/action-setup@v5
|
|
name: Install pnpm
|
|
id: pnpm-install
|
|
with:
|
|
version: 10
|
|
run_install: false
|
|
|
|
- name: check github release done
|
|
run: |
|
|
for ((attempt=1; attempt<=10; attempt++)); do
|
|
if wget -q --spider "https://github.com/dreamhunter2333/cloudflare_temp_email/releases/latest/download/frontend.zip"; then
|
|
echo "frontend.zip found."
|
|
break
|
|
else
|
|
if [ $attempt -eq 10 ]; then
|
|
echo "Exceeded maximum retries. frontend.zip not found."
|
|
else
|
|
echo "frontend.zip not found. Retrying in 30 seconds..."
|
|
sleep 30
|
|
fi
|
|
fi
|
|
done
|
|
|
|
- name: Deploy Docs for ${{github.ref_name}}
|
|
run: |
|
|
cd vitepress-docs/
|
|
wget https://github.com/dreamhunter2333/cloudflare_temp_email/releases/latest/download/frontend.zip -O docs/public/ui_install/frontend.zip
|
|
pnpm install --no-frozen-lockfile
|
|
if [[ ${{github.ref}} == refs/tags/* ]]; then
|
|
export TAG_NAME=${{github.ref_name}}
|
|
else
|
|
export TAG_NAME=$(git describe --tags --abbrev=0)
|
|
fi
|
|
echo "Deploying docs for tag $TAG_NAME"
|
|
pnpm run deploy
|
|
env:
|
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|