I can't host flutter web application on github pages. The workflow file looks like this:
name: Build & Deploy weathunits_configurator
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-deploy:
name: 'Build & Deploy web app'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Install Flutter and Dart SDK'
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.3.9
cache: true
- name: 'Flutter enable Web'
run: flutter config --enable-web
- name: 'Get dependencies'
run: flutter pub get
working-directory: example/weathunits_configurator
- name: 'Build web app'
run: |
cd example/weathunits_configurator
flutter build web --web-renderer=canvaskit --base-href='/weathunits_configurator/' --release
- name: 'Deploy web app'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: example/weathunits_configurator/build/web
What I'm trying to do: my project lies in the example/weathunits_configurator folder, after building it will be in the example/weathunits_configurator/build/web folder.
The web project is placed in the gh-pages branch and looks like this link.

We open the application through the https://packruble.github.io/weather_animation/ (I'd like to see another path. Not /weather_animation/, but /weathunits_configurator/.) and see a blank screen. I see the following in the console brave:

What I tried:
- Use
JamesIves/github-pages-deploy-action@v4instead ofpeaceiris/actions-gh-pages@v3 - Use different `flutter build web' parameters
- Changed the input and output folder in settings deploy action.
I think the problem is that because my project, which needs to be deployed, is in a subfolder, it cannot be built normally. Either there is a problem with the --base-href='/weathunits_configurator/' tag. Or the problem is somewhere else.
How to launch this project on Github Pages?
--base-href /weathunits_configurator/