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

44 lines
893 B
YAML
Raw Normal View History

2023-11-04 20:24:25 +05:30
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 20:27:52 +05:30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 6
- uses: pnpm/action-setup@v2.4.0
2023-11-04 20:24:25 +05:30
2023-11-04 20:27:52 +05:30
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
2023-11-04 20:24:25 +05:30
2023-11-04 20:27:52 +05:30
- run: pnpm install --no-frozen-lockfile
- name: Build
run: pnpm api:build
env:
2023-11-04 22:56:06 +05:30
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
2023-11-04 20:27:52 +05:30
NITRO_PRESET: cloudflare
- name: Publish to Cloudflare
2023-11-04 20:28:58 +05:30
uses: cloudflare/wrangler-action@v3
2023-11-04 20:27:52 +05:30
with:
2023-11-04 20:34:07 +05:30
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
2023-11-04 22:05:48 +05:30
vars: WEBHOOK_URL
2023-11-04 22:00:25 +05:30
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}