Remove unused code #11
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: On Website Deploy | |
"on": | |
push: | |
branches: | |
- "main" | |
paths: | |
- 'example/lib/**' | |
- 'example/web/**' | |
- 'lib/**' | |
- 'pubspec.yaml' | |
- '.github/workflows/main.yml' | |
jobs: | |
build_and_deploy_web: | |
name: Build & Deploy Flutter to Web | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- name: 🌍 Enable Web | |
run: | | |
cd ./example | |
flutter config --enable-web | |
- name: 📦 Get packages | |
run: | | |
cd ./example | |
flutter pub get | |
- name: 🏭 Build Web Application | |
run: | | |
cd ./example | |
flutter build web --release | |
- name: Checkout Destination Repository | |
uses: actions/checkout@v2 | |
with: | |
repository: flutter-task-manager/flutter-task-manager.github.io | |
token: ${{ secrets.PAT }} | |
path: 'destination_repo' | |
- name: Copy Files to Destination Repository | |
run: | | |
# 删除 destination_repo 目录下除了 .git 以外的所有文件 | |
find destination_repo -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} \; | |
cp -r example/build/web/* destination_repo/ | |
- name: Commit and Push | |
run: | | |
cd destination_repo | |
git config --local user.email "[email protected]" | |
git config --local user.name "cezres" | |
git add . | |
git commit -m "Update files" | |
git push --force |