Skip to content

Commit

Permalink
add workflow to build&deploy web
Browse files Browse the repository at this point in the history
also split the build-io and build-android workflow files
  • Loading branch information
X-Wei committed Jun 9, 2024
1 parent 1ffc05e commit 61aa797
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 41 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build-android

on:
workflow_dispatch:

jobs:
build-android-apk:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Cache Flutter
uses: actions/cache@v3
id: flutter-cache
with:
key: $GITHUB_SHA-flutter
path: ~/.flutter

- name: Cache Gradle
uses: actions/cache@v3
id: gradle-cache
with:
key: $GITHUB_SHA-gradle
path: ~/.gradle

- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: "19"
distribution: 'temurin'
cache: "gradle"

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- run: flutter pub get

- run: flutter build apk
Original file line number Diff line number Diff line change
@@ -1,68 +1,31 @@
name: build-app
name: build-ios

on:
workflow_dispatch:

jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Cache Flutter
uses: actions/cache@v2
id: flutter-cache
with:
key: $GITHUB_SHA-flutter
path: ~/.flutter

- name: Cache Gradle
uses: actions/cache@v2
id: gradle-cache
with:
key: $GITHUB_SHA-gradle
path: ~/.gradle

- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: "19"
distribution: 'temurin'
cache: "gradle"

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- run: flutter pub get

- run: flutter build apk

build-ios:
runs-on: macos-latest
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Cache CocoaPods
uses: actions/cache@v2
uses: actions/cache@v3
id: cocoa-pods-cache
with:
key: $GITHUB_SHA-cocoa-pods
path: ~/Library/Caches/CocoaPods

- name: Cache Xcode Derived Data
uses: actions/cache@v2
uses: actions/cache@v3
id: xcode-derived-data-cache
with:
key: $GITHUB_SHA-xcode-derived-data
path: ~/Library/Developer/Xcode/DerivedData

- name: Cache Flutter
uses: actions/cache@v2
uses: actions/cache@v3
id: flutter-cache
with:
key: $GITHUB_SHA-flutter
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/publish-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish to Github Pages

on:
workflow_dispatch:

jobs:
build-and-deploy-web:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Cache Flutter
uses: actions/cache@v3
id: flutter-cache
with:
key: $GITHUB_SHA-flutter
path: ~/.flutter
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
# - name: Build and deploy to GH pages
# uses: bluefireteam/flutter-gh-pages@v7
- run: flutter pub get
- run: flutter build web --release
- name: Deploy to GH pages
uses: peaceiris/actions-gh-pages@v4

0 comments on commit 61aa797

Please sign in to comment.