Skip to content

Update gh-pages.yml

Update gh-pages.yml #5

Workflow file for this run

name: Github Pages
on:
push:
branches:
- main
- master
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
run: |
git clone https://github.com/flutter/flutter.git --depth 1 -b stable _flutter
echo "${GITHUB_WORKSPACE}/_flutter/bin" >> ${GITHUB_PATH}
- name: Install
run: |
flutter config --enable-web
flutter pub get
- name: Build
run: flutter build web --base-href "/${{ github.event.repository.name }}/"
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
- name: Deploy (Test)
uses: peaceiris/actions-gh-pages@v4
if: github.ref != 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
publish_branch: gh-pages-test