forked from Okeanos/antora-gh-pages-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 1.77 KB
/
pages.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
# yaml-language-server:$schema=https://json.schemastore.org/github-workflow.json
# https://docs.github.com/en/actions/writing-workflows
name: Publish Pages
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
workflow_dispatch:
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read # to read the repository itself
pages: write # to configure to Pages
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Extract Tool Versions
id: tool-versions
run: |
node_version=$(grep -F 'node' .mise.toml | cut -d '=' -f2 | xargs)
echo "node_version=${node_version}" >> "$GITHUB_OUTPUT"
- name: Set up NodeJs
uses: actions/setup-node@v4
with:
node-version: ${{ steps.tool-versions.outputs.node_version }}
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Install Dependencies
run: npm ci
- name: Generate Site
run: npx antora antora-playbook.yml
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/site
deploy:
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate sourc
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4