3341be45f8
Refs: - https://developers.cloudflare.com/pages/get-started/direct-upload/ - https://developers.cloudflare.com/workers/wrangler/commands/#deploy-1 - https://github.com/cloudflare/pages-action/issues/117 - https://github.com/cloudflare/wrangler-action
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
name: "Deploy preview (web)"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
app:
|
|
description: "App to build and deploy"
|
|
type: choice
|
|
required: true
|
|
default: "photos"
|
|
options:
|
|
- "accounts"
|
|
- "auth"
|
|
- "cast"
|
|
- "payments"
|
|
- "photos"
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: web
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Setup node and enable yarn caching
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: "yarn"
|
|
cache-dependency-path: "web/yarn.lock"
|
|
|
|
- name: Install dependencies
|
|
run: yarn install
|
|
|
|
- name: Build ${{ inputs.app }}
|
|
run: yarn build:${{ inputs.app }}
|
|
|
|
- name: Publish ${{ inputs.app }} to preview
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
command: pages deploy --project-name=ente --commit-dirty=true --branch=preview web/apps/${{ inputs.app }}/out
|