Skip to content

Commit 61aa797

Browse files
committed
add workflow to build&deploy web
also split the build-io and build-android workflow files
1 parent 1ffc05e commit 61aa797

File tree

3 files changed

+74
-41
lines changed

3 files changed

+74
-41
lines changed

.github/workflows/build-android.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: build-android
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-android-apk:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Clone repository
11+
uses: actions/checkout@v4
12+
13+
- name: Cache Flutter
14+
uses: actions/cache@v3
15+
id: flutter-cache
16+
with:
17+
key: $GITHUB_SHA-flutter
18+
path: ~/.flutter
19+
20+
- name: Cache Gradle
21+
uses: actions/cache@v3
22+
id: gradle-cache
23+
with:
24+
key: $GITHUB_SHA-gradle
25+
path: ~/.gradle
26+
27+
- name: Set up JDK 19
28+
uses: actions/setup-java@v4
29+
with:
30+
java-version: "19"
31+
distribution: 'temurin'
32+
cache: "gradle"
33+
34+
- name: Set up Flutter
35+
uses: subosito/flutter-action@v2
36+
with:
37+
channel: stable
38+
cache: true
39+
40+
- run: flutter pub get
41+
42+
- run: flutter build apk

.github/workflows/flutter-actions.yml .github/workflows/build-ios.yml

+4-41
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,31 @@
1-
name: build-app
1+
name: build-ios
22

33
on:
44
workflow_dispatch:
55

66
jobs:
7-
build-android:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Clone repository
11-
uses: actions/checkout@v4
12-
13-
- name: Cache Flutter
14-
uses: actions/cache@v2
15-
id: flutter-cache
16-
with:
17-
key: $GITHUB_SHA-flutter
18-
path: ~/.flutter
19-
20-
- name: Cache Gradle
21-
uses: actions/cache@v2
22-
id: gradle-cache
23-
with:
24-
key: $GITHUB_SHA-gradle
25-
path: ~/.gradle
26-
27-
- name: Set up JDK 19
28-
uses: actions/setup-java@v4
29-
with:
30-
java-version: "19"
31-
distribution: 'temurin'
32-
cache: "gradle"
33-
34-
- name: Set up Flutter
35-
uses: subosito/flutter-action@v2
36-
with:
37-
channel: stable
38-
cache: true
39-
40-
- run: flutter pub get
41-
42-
- run: flutter build apk
43-
447
build-ios:
458
runs-on: macos-latest
469
steps:
4710
- name: Clone repository
4811
uses: actions/checkout@v4
4912

5013
- name: Cache CocoaPods
51-
uses: actions/cache@v2
14+
uses: actions/cache@v3
5215
id: cocoa-pods-cache
5316
with:
5417
key: $GITHUB_SHA-cocoa-pods
5518
path: ~/Library/Caches/CocoaPods
5619

5720
- name: Cache Xcode Derived Data
58-
uses: actions/cache@v2
21+
uses: actions/cache@v3
5922
id: xcode-derived-data-cache
6023
with:
6124
key: $GITHUB_SHA-xcode-derived-data
6225
path: ~/Library/Developer/Xcode/DerivedData
6326

6427
- name: Cache Flutter
65-
uses: actions/cache@v2
28+
uses: actions/cache@v3
6629
id: flutter-cache
6730
with:
6831
key: $GITHUB_SHA-flutter

.github/workflows/publish-web.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish to Github Pages
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-and-deploy-web:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Clone repository
11+
uses: actions/checkout@v4
12+
- name: Cache Flutter
13+
uses: actions/cache@v3
14+
id: flutter-cache
15+
with:
16+
key: $GITHUB_SHA-flutter
17+
path: ~/.flutter
18+
- name: Set up Flutter
19+
uses: subosito/flutter-action@v2
20+
with:
21+
channel: stable
22+
cache: true
23+
# - name: Build and deploy to GH pages
24+
# uses: bluefireteam/flutter-gh-pages@v7
25+
- run: flutter pub get
26+
- run: flutter build web --release
27+
- name: Deploy to GH pages
28+
uses: peaceiris/actions-gh-pages@v4

0 commit comments

Comments
 (0)