Merge branch 'main' of https://github.com/HauTranCong/flutterui into … #1
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 Flutter Web to flutterui-webapp | |
on: | |
push: | |
branches: | |
- main # Change if using a different branch | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout flutterui repository | |
uses: actions/checkout@v3 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: 3.27.1 # Adjust based on your Flutter version | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build Flutter web | |
run: flutter build web --release | |
- name: Checkout flutterui-webapp repository | |
run: | | |
git clone https://github.com/HauTranCong/flutterui-webapp deploy_repo | |
rm -rf deploy_repo/* | |
cp -r build/web/* deploy_repo/ | |
cd deploy_repo | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m "Auto-deploy from flutterui" | |
git push https://HauTrancong:${{ secrets.DEPLOY_TOKEN }}@github.com/HauTrancong/flutterui-webapp.git main |