-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 2 KB
/
docs.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
name: docs
on:
pull_request:
paths:
- "docs/**"
- "mkdocs.yml"
push:
branches:
- main
tags:
- "v*.*.*"
paths:
- "docs/**"
- "mkdocs.yml"
workflow_dispatch:
permissions:
contents: write
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: GHCR Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_GHCR }}
- run: docker pull ghcr.io/purpleclay/mkdocs-material-insiders:${{ vars.MKDOCS_MATERIAL_INSIDERS_VERSION }}
- name: Build
run: docker run --rm -i -v ${PWD}:/docs ghcr.io/purpleclay/mkdocs-material-insiders:${{ vars.MKDOCS_MATERIAL_INSIDERS_VERSION }} build
- name: HTML Test
uses: wjdp/htmltest-action@master
with:
path: site
config: htmltest.yml
- name: Patch mkdocs.yml Site URL
if: ${{ startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch') }}
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'site_url: ""'
replace: 'site_url: "https://docs.purpleclay.dev/${{ github.event.repository.name }}/"'
regex: false
include: mkdocs.yml
- name: Patch mkdocs.yml Edit URI
if: ${{ startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch') }}
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'edit_uri: ""'
replace: 'edit_uri: "edit/main/docs"'
regex: false
include: mkdocs.yml
- name: Deploy documentation
if: ${{ startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch') }}
run: docker run --rm -i -v ${PWD}:/docs ghcr.io/purpleclay/mkdocs-material-insiders:${{ vars.MKDOCS_MATERIAL_INSIDERS_VERSION }} gh-deploy --force