FMHYedit/.github/workflows/deploy-api.yml

44 lines
893 B
YAML
Raw Normal View History

2023-11-04 14:54:25 +00:00
name: Deploy API
on:
push:
branches:
- main
- vitepress
pull_request:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
ci:
name: Release
runs-on: ubuntu-latest
2023-11-04 14:57:52 +00:00
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 6
- uses: pnpm/action-setup@v2.4.0
2023-11-04 14:54:25 +00:00
2023-11-04 14:57:52 +00:00
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
2023-11-04 14:54:25 +00:00
2023-11-04 14:57:52 +00:00
- run: pnpm install --no-frozen-lockfile
- name: Build
run: pnpm api:build
env:
2023-11-04 17:26:06 +00:00
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
2023-11-04 14:57:52 +00:00
NITRO_PRESET: cloudflare
- name: Publish to Cloudflare
2023-11-04 14:58:58 +00:00
uses: cloudflare/wrangler-action@v3
2023-11-04 14:57:52 +00:00
with:
2023-11-04 15:04:07 +00:00
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
2023-11-04 16:35:48 +00:00
vars: WEBHOOK_URL
2023-11-04 16:30:25 +00:00
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}