Skip to content

Commit 5764339

Browse files
committed
ci: add github actions workflow for deploy
- Deploy web app to GitHub Pages
1 parent 6c21fc6 commit 5764339

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Name of this workflow
2+
name: deploy
3+
4+
# Run this workflow when a push is made to the main branch
5+
on:
6+
push:
7+
branches: [ main ]
8+
jobs:
9+
build_and_deploy:
10+
runs-on: ubuntu-latest # Use the latest version of Ubuntu
11+
12+
steps:
13+
# 1. Checkout the repository code
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
# 2. Setup Flutter SDK
18+
- name: Setup Flutter
19+
uses: subosito/flutter-action@v2
20+
with:
21+
channel: 'stable' # Use the stable channel of Flutter
22+
23+
# 3. Get Flutter dependencies
24+
- name: Get dependencies
25+
run: flutter pub get
26+
27+
# 4. Build the Flutter web app
28+
# IMPORTANT: Replace <repository-name> with the name of your GitHub repository
29+
- name: Build Web App
30+
run: flutter build web --release --base-href /headlines-toolkit/
31+
32+
# 5. Deploy the built app to GitHub Pages
33+
- name: Deploy
34+
uses: peaceiris/actions-gh-pages@v3
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: ./build/web

0 commit comments

Comments
 (0)