fix(app): improve composer autocomplete and draft persistence #100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Web (Cloudflare Pages) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/deploy-web.yml' | |
| - 'apps/free/app/**' | |
| - 'packages/core/**' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - 'pnpm-workspace.yaml' | |
| - 'turbo.json' | |
| workflow_dispatch: | |
| jobs: | |
| validate: | |
| name: Validate Web Changes | |
| runs-on: ${{ fromJSON(vars.MACOS_RUNNER_LABELS_JSON || vars.IOS_RUNNER_LABELS_JSON || '["self-hosted","macOS","ARM64","local-mac"]') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - uses: ./.github/actions/quality-gate | |
| deploy: | |
| needs: validate | |
| runs-on: ${{ fromJSON(vars.MACOS_RUNNER_LABELS_JSON || vars.IOS_RUNNER_LABELS_JSON || '["self-hosted","macOS","ARM64","local-mac"]') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build web | |
| working-directory: apps/free/app | |
| env: | |
| APP_ENV: production | |
| EXPO_PUBLIC_REVENUE_CAT_APPLE: ${{ secrets.EXPO_PUBLIC_REVENUE_CAT_APPLE }} | |
| EXPO_PUBLIC_REVENUE_CAT_GOOGLE: ${{ secrets.EXPO_PUBLIC_REVENUE_CAT_GOOGLE }} | |
| EXPO_PUBLIC_REVENUE_CAT_STRIPE: ${{ secrets.EXPO_PUBLIC_REVENUE_CAT_STRIPE }} | |
| run: | | |
| rm -rf dist | |
| APP_ENV=production npx expo export --platform web --clear | |
| # SPA 路由配置 for Cloudflare Pages | |
| echo '{"version":1,"include":["/*"],"exclude":["/_expo/*","/assets/*","/*.js","/*.css","/*.wasm","/*.ico","/*.png","/*.jpg","/*.svg"]}' > dist/_routes.json | |
| echo '/* /index.html 200' > dist/_redirects | |
| - name: Deploy to Cloudflare Pages | |
| working-directory: apps/free/app | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| run: | | |
| COMMIT_HASH=$(git rev-parse --short HEAD) | |
| npx wrangler pages deploy dist \ | |
| --project-name=free-app \ | |
| --commit-dirty=true \ | |
| --commit-message="deploy ${COMMIT_HASH}" |