generated from mpetuska/template-kmp-library
-
-
Notifications
You must be signed in to change notification settings - Fork 11
65 lines (60 loc) · 1.96 KB
/
deploy-pages.yml
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
60
61
62
63
64
65
name: Deploy Pages
on:
workflow_dispatch:
inputs:
version:
description: "Deploy version"
required: true
type: string
workflow_call:
inputs:
version:
description: "Deploy version"
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Resolve version
id: resolve
run: |
VERSION="${{ inputs.version }}"
VERSION="${VERSION:=${{ github.event.inputs.version }}}"
echo "::set-output name=version::${VERSION//v}"
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
- name: Restore Gradle cache
id: cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.gradle/yarn
~/.gradle/nodejs
~/.konan
~/.cache/yarn
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- uses: actions/checkout@v4
- name: Build Pages
run: ../gradlew assemble
working-directory: sandbox
- name: GZip Pages
run: |
REPO_NAME=${{ github.repository }}
REPO_NAME=${REPO_NAME#${{ github.repository_owner }}/}
cp -avr sandbox/build/dist/js/productionExecutable/ public;
find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \;
# echo "/${REPO_NAME} /${REPO_NAME}/${REPO_NAME}/index.html 301" > public/_redirects;
# echo "/${REPO_NAME}/index.html /${REPO_NAME}/${REPO_NAME}/index.html 301" >> public/_redirects;
echo "kmdc.petuska.dev" > public/CNAME
- uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: public
env:
GITHUB_TOKEN: ${{ github.token }}