build:update version #20
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: Flutter Web Build and Deploy | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# 检出代码 | |
- uses: actions/checkout@v4 | |
# 安装 Flutter SDK | |
- name: Install Flutter SDK | |
run: | | |
curl -O https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.13.0-stable.tar.xz | |
tar xf flutter_linux_3.13.0-stable.tar.xz | |
export PATH="$PATH:$PWD/flutter/bin" | |
flutter doctor | |
# 安装依赖项 | |
- name: Install dependencies | |
run: flutter pub get | |
# 构建 Flutter Web 项目 | |
- name: Build Flutter Web | |
run: flutter build web --release | |
# 部署到 GitHub Pages | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: build/web |