-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (47 loc) · 1.76 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
name: Docs CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
# Use container from ghcr
container:
image: ghcr.io/pandablocks/pandablocks-dev-container:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
volumes:
- ${{ github.workspace }}:/repos
- ${{ github.workspace }}/build:/build
steps:
# Git repositories
- name: Checkout Source
uses: actions/checkout@v2
with:
path: PandABlocks-server
# require history to get back to last tag for version number of branches
fetch-depth: 0
# Build
- name: Build Docs
run: |
cd PandABlocks-server
ln -s CONFIG.example CONFIG
make docs
# Verification of build files
#- name: List build files
# run: ls ${{ github.workspace }}/build/html
# Publish
- name: Move to versioned directory
# e.g. master or 0.1.2
run: mv build/build-server/html "PandABlocks-server/.github/pages/${GITHUB_REF##*/}"
- name: Publish Docs to gh-pages
# Only master and tags are published
if: "${{ github.repository_owner == 'PandABlocks' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')) }}"
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: PandABlocks-server/.github/pages
keep_files: true