Skip to content

Deploy Web to GitHub Pages #6

Deploy Web to GitHub Pages

Deploy Web to GitHub Pages #6

Workflow file for this run

name: Deploy Web to GitHub Pages
on:
workflow_run:
workflows: ["Flutter CI"]
types:
- completed
branches: [ main ]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build Web Release
run: flutter build web --release
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
keep_files: true