ci: use flutter SDK when publishing (#5) #7
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 Demo | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-deploy_demo | |
cancel-in-progress: true | |
jobs: | |
build: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
### Set up ### | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/[email protected] | |
with: | |
channel: stable | |
flutter-version: 3.22.0 | |
cache: true | |
cache-key: "flutter-:os:-:channel:-:version:-:arch:" | |
pub-cache-key: "flutter-pub-:os:-:channel:-:version:-:arch:" | |
### Build ### | |
- run: | | |
dart pub get | |
flutter build web --no-tree-shake-icons | |
working-directory: example | |
### Upload ### | |
- name: Upload GitHub Pages artifact | |
uses: actions/[email protected] | |
with: | |
path: example/build/web | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: demo | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy GitHub Pages site | |
id: deployment | |
uses: actions/[email protected] | |