Skip to content

Instantly share code, notes, and snippets.

@WieFel
Last active July 17, 2021 21:01
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save WieFel/735b87c5cc5c63a683d90a9bda588f30 to your computer and use it in GitHub Desktop.
Flutter web deployment to gh-pages - GitHub action
name: Deploy Web
# run on tag creation
on:
push:
tags:
- '*'
jobs:
deploy-for-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: beta
- run: flutter config --enable-web
- run: flutter pub get
- name: Build for web
working-directory: example/ # assuming example/ project folder should be built. remove this line if project root folder should be built.
run: flutter build web --release
- name: Deploy
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: example/build/web # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment