Skip to content

Commit

Permalink
Merge pull request #2 from ikhsan3adi/github-pages
Browse files Browse the repository at this point in the history
Github pages flutter web
  • Loading branch information
ikhsan3adi authored Apr 19, 2024
2 parents 4b04b60 + f1d1c7e commit d83d913
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/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web

- name: Deploy (Test)
uses: peaceiris/actions-gh-pages@v4
if: github.ref != 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
publish_branch: gh-pages-test

0 comments on commit d83d913

Please sign in to comment.