Bump flutter_lints from 2.0.3 to 3.0.0 in /example (#38) #70
This file contains 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 | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "11" | |
- uses: actions/configure-pages@v3 | |
id: configure | |
- name: cache flutter | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-${{ hashFiles('**/.fvm/fvm_config.json') }} | |
path: .fvm/cache | |
- name: add brew to $PATH | |
run: | | |
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH | |
- name: fvm install | |
run: | | |
brew tap leoafarias/fvm | |
brew install fvm | |
- name: flutter install | |
run: | | |
fvm config --cache-path .fvm/cache | |
fvm install | |
- name: update base_url | |
working-directory: 'example/web' | |
run: | | |
sed -i 's,base_url,${{ steps.configure.outputs.base_url }},g' robots.txt | |
sed -i 's,base_url,${{ steps.configure.outputs.base_url }},g' sitemap.xml | |
- name: flutter build | |
run: | | |
cd example | |
fvm config --cache-path ../.fvm/cache | |
fvm flutter pub get | |
fvm flutter build web --release --web-renderer auto --base-href "${{ steps.configure.outputs.base_path }}/" | |
# because GitHub doesn't support redirecting all to single index.html | |
# we duplicate (copy) index.html to all possible paths (https://github.com/orgs/community/discussions/27676#discussioncomment-3297224) | |
mkdir -p build/web/posts && cp build/web/index.html build/web/posts/index.html | |
END=64 | |
for ((i=0;i<END;i++)); do | |
mkdir -p build/web/posts/$i && cp build/web/index.html build/web/posts/$i/index.html | |
done | |
- name: upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: 'example/build/web' | |
- name: deploy github page | |
id: deployment | |
uses: actions/deploy-pages@v2 |