Introduce pub workspace and Flutter 3.27 (#309) #227
This file contains 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: Docs Deploy | |
on: | |
push: | |
branches: [main] | |
paths: | |
- '.github/workflows/docs_deploy.yaml' | |
- 'docs/**' | |
- 'samples/**' | |
workflow_dispatch: | |
inputs: | |
target: | |
type: choice | |
description: 'Environment' | |
required: true | |
options: | |
- development | |
- production | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: docs | |
cancel-in-progress: false | |
jobs: | |
docs: | |
name: Deploy Docs | |
runs-on: ubuntu-latest | |
environment: ${{ (startsWith(github.ref, 'refs/tags/forui') || inputs.target == 'production') && 'docs-production' || 'docs-development' }} | |
defaults: | |
run: | |
working-directory: ./docs | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- uses: actions/configure-pages@v5 | |
- run: pnpm install | |
- run: NEXT_PUBLIC_DEMO_URL=${{ vars.DEMO_URL }} pnpm run export | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy ./docs/out --project-name=${{ vars.CLOUDFLARE_DOCS_PROJECT_NAME }} --branch=main | |
samples: | |
name: Deploy Samples | |
runs-on: ubuntu-latest | |
environment: ${{ (startsWith(github.ref, 'refs/tags/forui') || inputs.target == 'production') && 'docs-production' || 'docs-development' }} | |
defaults: | |
run: | |
working-directory: ./samples | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/[email protected] | |
with: | |
flutter-version: 3.27.x | |
cache: true | |
- run: flutter pub get | |
- run: dart run build_runner build --delete-conflicting-outputs | |
- run: flutter build web | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy ./samples/build/web --project-name=${{ vars.CLOUDFLARE_DEMO_PROJECT_NAME }} --branch=main |