Last active
December 28, 2024 13:07
-
-
Save doctor-g/96c69a05cb45db1fc3b911b3f7436a65 to your computer and use it in GitHub Desktop.
Workflow to publish a Flutter Web app to GitHub Pages
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 to GitHub Pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-18.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: '1.19.x' | |
channel: 'beta' # Required for web | |
- name: Enable Flutter Web | |
run: flutter config --enable-web | |
- name: Download Dependencies | |
run: flutter pub get | |
- name: Build | |
run: flutter build web | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build/web | |
force_orphan: true | |
user_name: 'github-ci[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
commit_message: 'Publish to gh-pages' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment