-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (75 loc) · 1.83 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Publish Docs
on:
push:
branches:
- main
workflow_dispatch:
inputs:
push:
description: Push site to Github Pages?
required: false
default: false
type: boolean
tag:
description: Ref to build docs from?
required: false
type: string
workflow_call:
inputs:
push:
description: Push site to Github Pages?
required: false
default: true
type: boolean
tag:
description: Ref to build docs from?
required: true
type: string
secrets:
GH_APP_KEY:
description: GitHub App private key
required: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Setup
id: setup
uses: duplocloud/duploctl/.github/actions/setup@main
with:
ref: ${{ inputs.tag }}
fetch-depth: 0
install: ".[build,docs]"
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
submodules: "true"
- name: Generated Docs Folder
run: |
mkdir -p dist dist/docs
- name: Build Docs
run: mkdocs build
- name: Fix permissions
run: |
chmod -c -R +rX "dist/site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist/site
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
if: inputs.push || github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4