GitHub Action for Flutter Web

GitHub Action for Flutter Web

My Workflow

This GitHub Action "Flutter Web CI" is designed to automate the developers work to:

  • Configure the flutter tool for web support
  • Build an app with web support
  • Archive the build and upload the Artifact
  • Download the Artifact
  • Display structure of build files
  • Use GitHub Pages to host your Flutter Web app

Submission Category:

Maintainer Must-Haves and DIY Deployments

name: Flutter Web CI

    branches: [ master ]
    branches: [ master ]

    runs-on: ubuntu-latest
      my_secret: ${{secrets.GH_DEPLOY}}
    - uses: actions/checkout@v1
    - uses: subosito/flutter-action@v1
        channel: beta
    - run: flutter config --enable-web
    - run: flutter pub get
#     - run: flutter test
    - run: flutter build web
    - name: Archive Production Artifact
      uses: actions/upload-artifact@master
        name: web-build
        path: build/web
    - name: Download Artifact
      uses: actions/download-artifact@master
        name: web-build 
    - name: Display structure of build files
      run: ls -R
      working-directory: ./web
    - name: Deploy to GH Pages
      run: |
        cd build/web
        git init
        # type configurations: your and followed lines 
        # git config --global your_email 
        # git config --global your_name 
        git config --global
        git config --global himanshusharma89
        git status
        # change this remote url for examle your remote url is then the following:
        git remote add origin https://${{secrets.GH_DEPLOY}}
        git checkout -b gh-pages
        git add --all
        git commit -m "update"
        git push origin gh-pages -f

Additional Resources / Info

This GitHub Action uses the following open-source GitHub Actions:

Made with by Himanshu Sharma