Create static.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 Flutter Web to GitHub Pages | |
on: | |
push: | |
branches: ["master"] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.0.0' | |
channel: 'stable' | |
- name: Get dependencies | |
run: flutter pub get | |
- name: Build Flutter Web | |
run: flutter build web --release | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: web-demo | |
path: ./build/web | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download Web Build | |
uses: actions/download-artifact@v2 | |
with: | |
name: web-demo | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.MY_TOKEN }} | |
publish_dir: ./build/web |