-
-
Notifications
You must be signed in to change notification settings - Fork 758
105 lines (88 loc) · 2.65 KB
/
deploy-website.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Deploy Website
on:
push:
branches:
- main
jobs:
build-detekt-docs:
if: github.repository == 'detekt/detekt'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Build Detekt Documentation
uses: gradle/gradle-build-action@v2
with:
arguments: :detekt-generator:generateDocumentation
- name: Upload Generated Rules documentation
uses: actions/upload-artifact@v3
with:
name: detekt-generated-docs
path: docs/pages/documentation/
- name: Upload KDoc documentation
uses: actions/upload-artifact@v3
with:
name: detekt-kdoc
path: docs/pages/kdoc/
- name: Upload generated CLI options documentation
uses: actions/upload-artifact@v3
with:
name: detekt-cli-options-docs
path: docs/pages/gettingstarted/cli-options.md
build-website:
needs: build-detekt-docs
runs-on: ubuntu-latest
container: jekyll/builder
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: docs/vendor/bundle
key: cache-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: cache-gems-
- name: Unzipping Generated Rules documentation
uses: actions/download-artifact@v3
with:
name: detekt-generated-docs
path: docs/pages/documentation/
- name: Unzipping KDoc documentation
uses: actions/download-artifact@v3
with:
name: detekt-kdoc
path: docs/pages/kdoc/
- name: Unzipping generated CLI options documentation
uses: actions/download-artifact@v3
with:
name: detekt-cli-options-docs
path: docs/pages/gettingstarted/
- name: Display structure of files
run: ls -R
working-directory: docs/
- name: Create Directories
run: |
mkdir _site/
mkdir -p vendor/bundle/
chmod -R 777 _site/
chmod -R 777 vendor/
touch Gemfile.lock
chmod a+w Gemfile.lock
working-directory: docs/
- name: Install Ruby Dependencies
working-directory: docs/
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Build the Jekyll Website
run: bundle exec jekyll build -d _site/
working-directory: docs/
- name: Deploy Github Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/_site/