Skip to content

Commit

Permalink
workflow (ionic): upgraded files to use latest actions and commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashu-Dubey committed Jun 22, 2024
1 parent 946dae1 commit 934de95
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 26 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,42 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Setup Web environment to install packages.
- name: Setup Web environment
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
cache: 'npm'
# only required if project is not in the root
# cache-dependency-path: folder_name/package-lock.json

- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-

# Setup Java environment in order to build the Android app.
- name: Setup Java 11
- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
cache: 'gradle'
java-version: '17'

# Setup gradle using official gradle action
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
add-job-summary: 'on-failure'

- name: Install Ionic CLI
run: npm install -g @ionic/cli

- name: Install packages
run: npm install
run: npm ci

- name: Build the ionic project for Android
run: ionic capacitor build android --prod --no-open
Expand All @@ -52,7 +64,7 @@ jobs:
run: ./gradlew assembleDebug

- name: Save apk file as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ionic-actions-test
path: android/app/build/outputs/apk/debug/app-debug.apk
32 changes: 19 additions & 13 deletions .github/workflows/build-ios-simulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,35 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Setup Web environment to install packages.
- name: Setup Web environment
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
cache: 'npm'

- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-

- name: Install Ionic CLI
run: npm install -g @ionic/cli

- name: Install packages
run: npm install
run: npm ci

# improve iOS build compilation time
- name: Restore buildcache
uses: mikehardy/buildcache-action@v2
continue-on-error: true
# # improve iOS build compilation time
# - name: Restore buildcache
# uses: mikehardy/buildcache-action@v2
# continue-on-error: true

- name: Restore Pods cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
ios/Pods
Expand All @@ -51,7 +58,7 @@ jobs:
run: ionic capacitor build ios --prod --no-open

# - name: Restore build artifacts from cache
# uses: actions/cache@v3
# uses: actions/cache@v4
# with:
# path: ~/Library/Developer/Xcode/DerivedData
# key: ${{ runner.os }}-ios-derived-data-${{ hashFiles('ios/Podfile.lock') }}
Expand All @@ -69,7 +76,7 @@ jobs:
# zip -r -y -o output/rn_test_github_actions.zip rn_test_github_actions.app

# - name: Save build file as artifact
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: rn-ios-simulator-build
# path: ~/Library/Developer/Xcode/DerivedData/rn_test_github_actions-*/Build/Products/Release-iphonesimulator/output
Expand All @@ -82,7 +89,6 @@ jobs:
run: |
set -o pipefail
xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-scheme App \
-workspace App.xcworkspace \
-sdk iphonesimulator \
Expand All @@ -98,7 +104,7 @@ jobs:
zip -r -y -o output/ionic_github_action_ios.zip ionic_github_action_ios.app
- name: Save build file as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ionic-ios-simulator-build
path: ios/App/build/Build/Products/Release-iphonesimulator/output
17 changes: 12 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,26 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Setup Web environment to install packages.
- name: Setup Web environment
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
cache: 'npm'
## only required if project is not in the root
# cache-dependency-path: subdir/package-lock.json

- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-

- name: Install packages
run: npm install
run: npm ci

- name: Build web
run: npx ionic build --prod -- --base-href /test_github_action_delete/
Expand All @@ -47,7 +54,7 @@ jobs:
run: mv www/newIndex.html www/404.html

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./www

0 comments on commit 934de95

Please sign in to comment.