Skip to content

Commit

Permalink
Merge pull request #1 from chooyan-eng/gh-pages
Browse files Browse the repository at this point in the history
add GitHub Actions workflow to deploy
  • Loading branch information
chooyan-eng committed Mar 1, 2024
2 parents 50b8b17 + 893bc5b commit 43f1131
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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: Get Flutter version
uses: kuhnroyal/flutter-fvm-config-action@v1

- name: Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
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

0 comments on commit 43f1131

Please sign in to comment.