2023-11-12 16:42:57 +00:00
|
|
|
name: Deploy API
|
|
|
|
|
|
|
|
on:
|
2024-02-29 11:39:31 +00:00
|
|
|
workflow_dispatch:
|
2023-11-12 16:42:57 +00:00
|
|
|
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
name: Release
|
|
|
|
runs-on: ubuntu-latest
|
2024-07-09 10:28:30 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [20]
|
|
|
|
|
2023-11-12 16:42:57 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 6
|
|
|
|
|
2024-07-09 10:28:30 +00:00
|
|
|
- name: Install pnpm
|
|
|
|
uses: pnpm/action-setup@v4
|
2024-07-09 10:30:20 +00:00
|
|
|
|
2024-07-09 10:28:30 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v4
|
2023-11-12 16:42:57 +00:00
|
|
|
with:
|
2024-07-09 10:28:30 +00:00
|
|
|
node-version: ${{ matrix.node-version }}
|
2024-01-25 16:32:45 +00:00
|
|
|
cache: 'pnpm'
|
2023-11-12 16:42:57 +00:00
|
|
|
|
2024-07-09 10:28:30 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
2023-11-12 16:42:57 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: pnpm api:build
|
|
|
|
env:
|
|
|
|
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
|
|
|
|
NITRO_PRESET: cloudflare
|
|
|
|
|
|
|
|
- name: Publish to Cloudflare
|
|
|
|
uses: cloudflare/wrangler-action@v3
|
|
|
|
with:
|
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
|
|
vars: WEBHOOK_URL
|
|
|
|
env:
|
|
|
|
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
|