Add sed command to replace $FLUTTER_BASE_HREF with '/' (#7) #10
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: Build and deploy on GitHub Pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- run: flutter pub get | |
- run: flutter test | |
- run: flutter build web | |
- name: Update base href for GitHub Pages | |
run: sed -i 's|\$FLUTTER_BASE_HREF|/|' build/web/index.html | |
- name: Copy index.html to 404.html | |
run: cp build/web/index.html build/web/404.html | |
- uses: crazy-max/ghaction-github-pages@v3 | |
with: | |
target_branch: gh-pages | |
build_dir: build/web | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |