55 - demo_v2
66 workflow_dispatch : # This will allow the workflow to be triggered manually
77
8+ # jobs:
9+ # build:
10+ # name: Build Web
11+ # env:
12+ # my_secret: ${{ secrets.commit_secret }} # Ensure this secret is configured correctly
13+ # runs-on: ubuntu-latest
14+
15+ # steps:
16+ # - uses: actions/checkout@v3
17+
18+ # # Set up Flutter
19+ # - uses: subosito/flutter-action@v2
20+ # with:
21+ # channel: 'stable'
22+
23+ # # Enable web support for Flutter
24+ # - run: flutter config --enable-web
25+
26+ # # Build the web app
27+ # - run: |
28+ # cd example
29+ # flutter pub get
30+ # flutter build web --release --base-href "/flutter_janus_client/"
31+
32+ # # Set up git for deployment to gh-pages
33+ # - run: |
34+ # # Configure git user identity
35+ # git config --global user.email "shivanshtalwar0@gmail.com"
36+ # git config --global user.name "shivanshtalwar0"
37+
38+ # # Create a new gh-pages branch (or use existing one)
39+ # git fetch
40+ # git checkout gh-pages || git checkout --orphan gh-pages
41+
42+ # # Add the build output to the repository
43+ # git add --all
44+ # git commit -m "Update Flutter Web Build"
45+
46+ # # Push the changes to gh-pages
47+ # git push https://${{ secrets.GITHUB_TOKEN }}@github.com/flutterjanus/flutter_janus_client.git gh-pages -f
48+
849jobs :
9- build :
10- name : Build Web
11- env :
12- my_secret : ${{ secrets.commit_secret }} # Ensure this secret is configured correctly
50+ build-and-deploy :
51+ name : Build and Deploy
1352 runs-on : ubuntu-latest
1453
1554 steps :
55+ # Checkout the source code
1656 - uses : actions/checkout@v3
1757
1858 # Set up Flutter
1959 - uses : subosito/flutter-action@v2
2060 with :
21- channel : ' stable'
61+ channel : stable
2262
23- # Enable web support for Flutter
63+ # Enable Flutter web support
2464 - run : flutter config --enable-web
2565
26- # Build the web app
27- - run : |
28- cd example
29- flutter pub get
30- flutter build web --release --base-href "/flutter_janus_client/"
66+ # Get dependencies
67+ - run : flutter pub get
3168
32- # Set up git for deployment to gh-pages
33- - run : |
34- # Configure git user identity
35- git config --global user.email "shivanshtalwar0@gmail.com"
36- git config --global user.name "shivanshtalwar0"
69+ # Build the web release
70+ - run : flutter build web --release --base-href "/flutter_janus_client/"
71+ # Replace <your-repo-name> with your GitHub repo name
3772
38- # Create a new gh-pages branch (or use existing one)
39- git fetch
40- git checkout gh-pages || git checkout --orphan gh-pages
41-
42- # Add the build output to the repository
43- git add --all
44- git commit -m "Update Flutter Web Build"
45-
46- # Push the changes to gh-pages
47- git push https://${{ secrets.GITHUB_TOKEN }}@github.com/flutterjanus/flutter_janus_client.git gh-pages -f
73+ # Deploy to GitHub Pages
74+ - name : Deploy to GitHub Pages
75+ uses : peaceiris/actions-gh-pages@v3
76+ with :
77+ github_token : ${{ secrets.GITHUB_TOKEN }}
78+ publish_dir : ./build/web
0 commit comments