Skip to content

Instantly share code, notes, and snippets.

@nekomimi-daimao
Last active October 16, 2022 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nekomimi-daimao/f744ce42280dadb6040f2e4f38984650 to your computer and use it in GitHub Desktop.
Save nekomimi-daimao/f744ce42280dadb6040f2e4f38984650 to your computer and use it in GitHub Desktop.
deploy flutter web for github pages
name: github pages
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Repository
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
echo ::set-output name=repository::$REPOSITORY
- name: Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.0.0'
channel: 'stable'
cache: true
- run: flutter --version
- run: flutter pub get
- run: flutter build web --web-renderer html --base-href /${{ steps.version.outputs.repository }}/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment