Merge pull request #42 from Resellio/develop #8
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: Deploy Flutter Web to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the repository code | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| # Set up Flutter environment | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.29.x' | |
| channel: 'stable' | |
| # Install dependencies | |
| - name: Install Dependencies | |
| run: flutter pub get | |
| # Run build_runner | |
| - name: Run build_runner | |
| run: dart run build_runner build --delete-conflicting-outputs | |
| # Build the web app | |
| - name: Build Flutter Web | |
| run: flutter build web --release --base-href "/client/" | |
| # Deploy to GitHub Pages | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub | |
| publish_dir: build/web # Directory containing the built web app | |
| publish_branch: gh-pages # Target branch for GitHub Pages |