Skip to content

Commit 5074d3d

Browse files
feat: 💚 Github Action for Web example release
- Updates web example on github page for every new github release published.
1 parent 43c03f7 commit 5074d3d

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: web-example-release
2+
on:
3+
workflow_dispatch: # Allows manual triggering
4+
release:
5+
types: [published] # Triggers when a release is published
6+
7+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
14+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 15
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
26+
steps:
27+
- name: Checkout input branch from github
28+
uses: actions/[email protected]
29+
- name: Flutter action
30+
uses: subosito/[email protected]
31+
with:
32+
flutter-version: '3.32.5'
33+
cache: true
34+
cache-key: 'flutter-3.32.5-stable'
35+
cache-path: '${{ runner.tool_cache }}/flutter/3.32.5-stable'
36+
pub-cache-key: 'flutter-pub-3.32.5-stable'
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v5
39+
- name: Project Clean Up
40+
run: flutter clean && flutter pub get
41+
- name: Build Web App
42+
run: cd example && flutter build web --base-href="/showcaseview/"
43+
- name: Upload Web Artifact
44+
uses: actions/[email protected]
45+
with:
46+
path: 'example/build/web'
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/[email protected]

0 commit comments

Comments
 (0)