-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yaml
59 lines (50 loc) · 1.58 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: 'Publish KMP Web App To GitHub Pages'
description: 'Publish the web application on GitHub Pages'
author: 'Mifos Initiative'
branding:
icon: 'package'
color: 'orange'
inputs:
web_package_name:
description: 'Name of the Web project module'
required: true
outputs:
page_url:
description: 'URL of the deployed web application'
value: ${{ steps.deployment.outputs.page_url }}
runs:
using: 'composite'
steps:
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
# Cache Gradle dependencies and build outputs to speed up future builds
- name: Cache Gradle and build outputs
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.konan
build
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Build Web(JS) App
shell: bash
run: ./gradlew jsBrowserDistribution
# Save web app as artifact
- name: Upload Web Artifact
uses: actions/upload-artifact@v4
with:
name: web-app
path: './${{ inputs.web_package_name }}/build/dist/js/productionExecutable'
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3
with:
path: './${{ inputs.web_package_name }}/build/dist/js/productionExecutable/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4