57 lines (46 loc) · 1.65 KB
/
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
name: Build and Deploy Website
on:
push:
branches:
- main
pull_request:
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
permissions:
contents: write # for JamesIves/github-pages-deploy-action to push changes in repo
jobs:
build-detekt-docs:
if: github.repository == 'detekt/detekt'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4
with:
java-version: 21
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: 'website/yarn.lock'
- name: Run generateWebsite
run: ./gradlew :detekt-generator:generateWebsite
- name: Install Yarn Dependencies
working-directory: website/
run: yarn install --frozen-lockfile
- name: Build the Detekt Website
working-directory: website/
run: yarn build
- name: Deploy GitHub Pages (only on main)
uses: JamesIves/github-pages-deploy-action@ec9c88baef04b842ca6f0a132fd61c762aa6c1b0 # v4
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
branch: gh-pages
folder: website/build/