-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
88 lines (74 loc) · 2.5 KB
/
action.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
77
78
79
80
81
82
83
84
85
86
87
name: 'Writerside Documentation Build and Deploy'
description: 'Build and deploy Writerside documentation to GitHub Pages'
author: 'xooooooooox'
branding:
color: 'purple'
icon: 'book'
inputs:
instance:
description: 'Specify the module name and instance ID, separated by a slash (e.g. Writerside/hi)'
required: true
default: 'Writerside/hi'
docker_version:
description: 'The Docker version to use'
required: false
default: '243.22562'
outputs:
page_url:
value: ${{ steps.deployment.outputs.page_url }}
description: 'The URL of the deployed GitHub Pages site'
runs:
using: 'composite'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Define instance id and artifacts
id: define-ids
run: |
input_instance=${{ inputs.instance }}
INSTANCE=${input_instance#*/}
INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]')
ARTIFACT="webHelp${INSTANCE_ID_UPPER}2-all.zip"
ALGOLIA_ARTIFACT="algolia-indexes-${INSTANCE_ID_UPPER}.zip"
echo "INSTANCE_ID_UPPER=$INSTANCE_ID_UPPER" >> $GITHUB_ENV
echo "ARTIFACT=$ARTIFACT" >> $GITHUB_ENV
echo "ALGOLIA_ARTIFACT=$ALGOLIA_ARTIFACT" >> $GITHUB_ENV
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
echo "algolia_artifact=$ALGOLIA_ARTIFACT" >> $GITHUB_OUTPUT
shell: bash
- name: Build docs using Writerside Docker builder
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ inputs.instance }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ inputs.docker_version }}
- name: Save artifact with build results
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
artifacts/${{ env.ALGOLIA_ARTIFACT }}
retention-days: 7
- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ inputs.instance }}
- name: List artifacts directory
run: ls -la artifacts
shell: bash
- name: Unzip artifact
run: unzip -O UTF-8 -qq "artifacts/${{ env.ARTIFACT }}" -d dir
shell: bash
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Package and upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dir
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4