-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.88 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
name: Docs
on:
workflow_dispatch:
push:
branches:
- main
paths:
- docs/**
- mkdocs.yml
- .github/workflows/Docs.yml
jobs:
DeployDocs:
# Grant the minimum permissions necessary for this job to publish to GitHub Pages
permissions:
contents: write
pages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
key: ${{ runner.os }}
path: .cache
- name: Load PSDepend Requirements
id: psdepend
shell: pwsh
run: |
$reqs = Import-PowerShellDataFile ./requirements.psd1
$moduleNames = $reqs.Keys | Where-Object { $_ -ne 'PSDependOptions' -and $null -eq $reqs[$_].DependencyType }
$dependencyList = ($moduleNames | Sort-Object | ForEach-Object { '{0}:{1}' -f $_, $reqs[$_].Version }) -join ', '
"psdependencies=$dependencyList" >> $env:GITHUB_OUTPUT
- name: Install and cache PowerShell modules
uses: potatoqualitee/[email protected]
with:
modules-to-cache: ${{ steps.psdepend.outputs.psdependencies }}
- id: image-cache
uses: actions/cache@v4
with:
key: ${{ runner.os }}-docker-cache
path: .docker
- name: Cache docker image
if: steps.image-cache.outputs.cache-hit != 'true'
shell: pwsh
run: |
$null = New-Item .docker/ -ItemType Directory -Force
docker pull squidfunk/mkdocs-material:9
docker save -o ./.docker/mkdocs-material.tar squidfunk/mkdocs-material:9
- if: steps.image-cache.outputs.cache-hit == 'true'
run: docker load -i ./.docker/mkdocs-material.tar
- name: MkDocs GH-Deploy
if: github.ref == 'refs/heads/main'
shell: pwsh
run: .\build.ps1 -Bootstrap -Task PublishDocs