generated from sdavids/sdavids-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (62 loc) · 1.98 KB
/
publish.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
---
# SPDX-FileCopyrightText: © 2024 Sebastian Davids <[email protected]>
# SPDX-License-Identifier: Apache-2.0
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: gh-pages
on: # yamllint disable-line rule:truthy
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-22.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
uses: actions/[email protected]
- name: Classify changes
# https://github.com/dorny/paths-filter/releases
uses: dorny/[email protected]
id: changes
with:
filters: |
docs:
- 'docs/**'
- if: steps.changes.outputs.docs == 'true'
name: Configure Pages
# https://github.com/actions/configure-pages
uses: actions/[email protected]
- if: steps.changes.outputs.docs == 'true'
name: Setup Node.js
# https://github.com/actions/setup-node/releases
uses: actions/[email protected]
with:
node-version: 20.18.0
- if: steps.changes.outputs.docs == 'true'
name: Install Antora
run: npm i [email protected]
- if: steps.changes.outputs.docs == 'true'
name: Generate Site
run: npx antora docs/antora-playbook.yml
- if: steps.changes.outputs.docs == 'true'
name: Upload Artifacts
# https://github.com/actions/upload-pages-artifact
uses: actions/[email protected]
with:
path: docs/build/site
- if: steps.changes.outputs.docs == 'true'
name: Deploy to GitHub Pages
id: deployment
# https://github.com/actions/deploy-pages
uses: actions/[email protected]