test #19
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 | |
| on: | |
| push: | |
| branches: | |
| - demo_v2 | |
| jobs: | |
| build: | |
| name: Build Web | |
| env: | |
| my_secret: ${{ secrets.commit_secret }} # Ensure this secret is configured correctly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # Set up Flutter | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| # Enable web support for Flutter | |
| - run: flutter config --enable-web | |
| # Build the web app | |
| - run: | | |
| cd example | |
| flutter pub get | |
| flutter build web --release --base-href "/flutter_janus_client/" | |
| # Set up git for deployment | |
| - run: | | |
| git init | |
| git config --global user.email "shivanshtalwar0@gmail.com" | |
| git config --global user.name "shivanshtalwar0" | |
| # Ensure the repository URL is correct and the remote URL uses the commit secret | |
| git remote add origin https://${{ secrets.commit_secret }}@github.com/flutterjanus/flutter_janus_client.git | |
| # Checkout the gh-pages branch (ensure it's created or exists) | |
| git fetch | |
| git checkout gh-pages || git checkout --orphan gh-pages | |
| # Add the build output to the repository | |
| git add --all | |
| git commit -m "Update Flutter Web Build" | |
| # Push the changes to gh-pages | |
| git push origin gh-pages -f |