mirror of
https://github.com/prdlk/leetcode.git
synced 2026-09-16 23:16:26 +00:00
ci(ci): update workflow script paths and add API deployment job
This commit is contained in:
@@ -28,7 +28,7 @@ jobs:
|
|||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
|
|
||||||
# No install step: the script only uses Bun builtins + fetch.
|
# No install step: the script only uses Bun builtins + fetch.
|
||||||
- run: bun scripts/close-solved.ts
|
- run: bun apps/cli/close-solved.ts
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
DRY_RUN: ${{ inputs.dry_run }}
|
DRY_RUN: ${{ inputs.dry_run }}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
|
|
||||||
# No install step: the script only uses Bun builtins + fetch.
|
# No install step: the script only uses Bun builtins + fetch.
|
||||||
- run: bun scripts/close-topics.ts
|
- run: bun apps/cli/close-topics.ts
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
DRY_RUN: ${{ inputs.dry_run }}
|
DRY_RUN: ${{ inputs.dry_run }}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Deploy Docs
|
name: Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -10,8 +10,11 @@ permissions:
|
|||||||
pages: write
|
pages: write
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
|
# The Worker deploy is idempotent (wrangler uploads the whole bundle), so on a
|
||||||
|
# burst of pushes only the last one matters: cancel-in-progress is correct for
|
||||||
|
# both the Pages build and the Worker job.
|
||||||
concurrency:
|
concurrency:
|
||||||
group: pages
|
group: deploy
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -31,7 +34,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/upload-pages-artifact@v3
|
- uses: actions/upload-pages-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: dist
|
path: apps/docs/dist
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: build
|
needs: build
|
||||||
@@ -42,3 +45,24 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- id: deployment
|
- id: deployment
|
||||||
uses: actions/deploy-pages@v4
|
uses: actions/deploy-pages@v4
|
||||||
|
|
||||||
|
# Deploys on every main push (not path-filtered): apps/api/data/schedule.json
|
||||||
|
# is bundled at deploy time, and re-deploying an unchanged Worker is a no-op.
|
||||||
|
# Needs repo secrets CLOUDFLARE_API_TOKEN (Workers Scripts: Edit) and
|
||||||
|
# CLOUDFLARE_ACCOUNT_ID.
|
||||||
|
deploy-api:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: oven-sh/setup-bun@v2
|
||||||
|
|
||||||
|
- run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
# DST cron guards must hold before the Worker ships.
|
||||||
|
- run: bun run api:test
|
||||||
|
|
||||||
|
- run: bun run api:deploy
|
||||||
|
env:
|
||||||
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
|||||||
Reference in New Issue
Block a user