Deploy GitHub Pages #7
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: 'Deploy GitHub Pages' | |
run-name: 'Deploy GitHub Pages' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
jobs: | |
code-analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- name: Prepare dependencies | |
run: | | |
flutter --version | |
flutter pub get | |
- name: Check Dart code formatting | |
run: | | |
dart format . -o none --set-exit-if-changed | |
- name: Analyze Dart code | |
run: | | |
flutter analyze . | |
deploy: | |
needs: [code-analysis] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- name: Prepare dependencies | |
run: | | |
flutter --version | |
flutter pub get | |
- name: Build web (wasm) | |
run: | | |
cd example | |
flutter build web --wasm --release | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: 'github-pages' | |
folder: 'example/build/web' |