Create deploy_web_preview_to_gh_pages.yml #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to GitHub Pages | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: app | |
- name: Checkout "eidmsdk_flutter" | |
uses: actions/checkout@v4 | |
with: | |
repository: slovensko-digital/eidmsdk-flutter | |
token: ${{ secrets.GH_PAT }} | |
path: eidmsdk_flutter | |
- name: Checkout "autogram_sign" | |
uses: actions/checkout@v4 | |
with: | |
repository: slovensko-digital/avm-client-dart | |
token: ${{ secrets.GH_PAT }} | |
path: autogram_sign | |
- uses: subosito/flutter-action@v1 | |
with: | |
flutter-version: '3.16.5' | |
channel: 'stable' | |
- name: Enable Flutter Web | |
run: flutter config --enable-web | |
- name: Install dependencies | |
working-directory: ./app | |
run: flutter pub get | |
- name: Build | |
working-directory: ./app | |
run: flutter build web --target=lib/preview.dart | |
# TODO Enable GH Pages: https://github.com/slovensko-digital/avm-app-flutter/settings/pages | |
# - name: Deploy | |
# TODO Use https://github.com/actions/deploy-pages instead | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: ./app/build/web | |
# force_orphan: true | |
# user_name: 'github-ci[bot]' | |
# user_email: 'github-actions[bot]@users.noreply.github.com' | |
# commit_message: 'Publish to gh-pages' |