[🤖bot] Update: host-redirect.min.js #1850
Workflow file for this run
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: build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# Declare default permissions as read only. | |
permissions: read-all | |
env: | |
NODE_VERSION: 20 | |
jobs: | |
test: | |
name: Analyze and test code examples | |
runs-on: ubuntu-latest | |
if: github.repository == 'cfug/flutter.cn' | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: "Beta channel" | |
branch: beta | |
experimental: true | |
- name: "Stable channel" | |
branch: stable | |
experimental: false | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
submodules: recursive | |
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 | |
with: | |
channel: ${{ matrix.branch }} | |
- name: Fetch Dart dependencies | |
run: dart pub get | |
continue-on-error: ${{ matrix.experimental }} | |
- name: Check Dart code formatting | |
run: dart run flutter_site format-dart --check | |
continue-on-error: ${{ matrix.experimental }} | |
- name: Analyze Dart code | |
run: dart run flutter_site analyze-dart | |
continue-on-error: ${{ matrix.experimental }} | |
- name: Run Dart tests | |
run: dart run flutter_site test-dart | |
continue-on-error: ${{ matrix.experimental }} | |
excerpts: | |
name: Check if code excerpts are up to date | |
runs-on: ubuntu-latest | |
if: github.repository == 'cfug/flutter.cn' | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
submodules: recursive | |
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 | |
with: | |
sdk: stable | |
- name: Fetch Dart dependencies | |
run: dart pub get | |
- name: Check if excerpts are up to date | |
run: dart run flutter_site refresh-excerpts --fail-on-update --dry-run | |
continue-on-error: ${{ matrix.experimental }} | |
linkcheck: | |
name: Build site and check links | |
runs-on: ubuntu-latest | |
if: | | |
github.repository == 'cfug/flutter.cn' | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
submodules: recursive | |
- name: Enable Corepack | |
run: corepack enable | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'pnpm' | |
- name: Setup pnpm | |
run: corepack install | |
- name: Install node dependencies | |
run: pnpm install --frozen-lockfile | |
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 | |
with: | |
sdk: stable | |
- name: Fetch Dart dependencies | |
run: dart pub get | |
- name: Build site | |
run: dart run flutter_site build | |
- name: Translated (docs.flutter.cn) | |
run: bash tool/translator/build.sh | |
shell: bash | |
- name: Check for broken Markdown link references | |
run: dart run flutter_site check-link-references | |
- name: Check for broken internal links | |
run: dart run flutter_site check-links | |
firebase-validate: | |
name: Validate Firebase configuration | |
runs-on: ubuntu-latest | |
if: github.repository == 'cfug/flutter.cn' | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
submodules: recursive | |
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 | |
with: | |
sdk: stable | |
- name: Fetch Dart dependencies | |
run: dart pub get | |
- name: Validate the firebase.json file | |
run: dart run flutter_site verify-firebase-json | |
deploy: | |
name: Deploy to production | |
needs: [test, excerpts, linkcheck, firebase-validate] | |
runs-on: ubuntu-latest | |
if: | | |
github.event_name == 'push' && | |
github.ref == 'refs/heads/main' && | |
github.repository == 'cfug/flutter.cn' | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
submodules: recursive | |
- name: Enable Corepack | |
run: corepack enable | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'pnpm' | |
- name: Setup pnpm | |
run: corepack install | |
- name: Install node dependencies | |
run: pnpm install --frozen-lockfile | |
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 | |
with: | |
sdk: stable | |
- name: Fetch Dart dependencies | |
run: dart pub get | |
- name: Build site | |
run: dart run flutter_site build | |
- name: Translated (docs.flutter.cn) | |
run: bash tool/translator/build.sh | |
shell: bash | |
- name: Deploy to production | |
run: bash tool/translator/deploy-cn.sh | |
shell: bash | |
env: | |
DEPLOY_USER: ${{ secrets.DOCS_REPO_DEPLOY_USER }} | |
DEPLOY_TOKEN: ${{ secrets.DOCS_REPO_DEPLOY_TOKEN }} |