Skip to content

Update GitHub Actions workflow to dynamically set base href for web d… #5

Update GitHub Actions workflow to dynamically set base href for web d…

Update GitHub Actions workflow to dynamically set base href for web d… #5

Workflow file for this run

name: Deploy Flutter Web to GitHub Pages
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable'
cache: true
- name: Get dependencies
run: flutter pub get
- name: Analyze code
run: flutter analyze
- name: Run tests
run: flutter test
- name: Build web
run: flutter build web --release --base-href "/${{ github.event.repository.name }}/"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
cname: false