diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml new file mode 100644 index 0000000..78f797c --- /dev/null +++ b/.github/workflows/gh-pages.yaml @@ -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 \ No newline at end of file