generated from mpetuska/template-kmp-library
-
-
Notifications
You must be signed in to change notification settings - Fork 11
76 lines (70 loc) · 2.41 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
66
67
68
69
70
71
72
73
74
75
76
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@v3
with:
distribution: 'adopt'
java-version: 11
- name: Restore Gradle cache
id: cache
uses: actions/cache@v3
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@v3
- 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/distributions/ 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/[email protected]
with:
target_branch: gh-pages
build_dir: public
env:
GITHUB_TOKEN: ${{ github.token }}
# - uses: actions/setup-python@v2
# with:
# python-version: 3.x
# - run: |
# git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git config --local user.name "github-actions[bot]"
# git fetch origin gh-pages --depth=1
# - run: |
# pip install mkdocs-material mike
# - run: ./gradlew :npm-publish-docs:mikeDeploy -Pversion='${{ steps.resolve.outputs.version }}'