Skip to content

Commit

Permalink
Merge pull request #9 from ikhsan3adi/flutter-web-gh-pages
Browse files Browse the repository at this point in the history
Create gh-pages.yml
  • Loading branch information
ikhsan3adi authored Apr 20, 2024
2 parents 36cf557 + dbb19c5 commit 8136dee
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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

0 comments on commit 8136dee

Please sign in to comment.