-
Notifications
You must be signed in to change notification settings - Fork 1.8k
61 lines (53 loc) · 2.12 KB
/
gh-pages.yml
File metadata and controls
61 lines (53 loc) · 2.12 KB
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
name: github-pages
on:
workflow_dispatch:
push:
paths:
- 'docs/**'
branches:
- master
- bugfix
# Taken from https://github.com/marketplace/actions/hugo-setup#%EF%B8%8F-workflow-for-autoprefixer-and-postcss-cli
# Both builds have to be one worflow as otherwise one publish will overwrite the other
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Setup Hugo
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
with:
hugo-version: '0.153.4' # renovate: datasource=github-releases depName=gohugoio/hugo
extended: true
- name: Setup Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '24.13.0' # TODO: Renovate helper might not be needed here - needs to be fully tested
- name: Cache dependencies
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Install dependencies
run: cd docs && npm ci
- name: Build production website
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: cd docs && hugo --minify --gc --config config/production/hugo.toml
- name: Deploy
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
if: github.repository == 'DefectDojo/django-DefectDojo' # Deploy docs only in core repo, not in forks - it would just fail in fork
with: # publishes to the `gh-pages` branch by default
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/public
cname: docs.defectdojo.com