-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (119 loc) · 3.65 KB
/
pkgdown.yml
File metadata and controls
138 lines (119 loc) · 3.65 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Copyright (C) 2025 Roberto Rossini <roberros@uio.no>
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This library is free software: you can redistribute it and/or
# modify it under the terms of the GNU Public License as published
# by the Free Software Foundation; either version 3 of the License,
# or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Public License along
# with this library. If not, see
# <https://www.gnu.org/licenses/>.
name: Deploy pkgdown website
on:
workflow_dispatch:
push:
branches: [main]
paths:
- ".github/workflows/pkgdown.yml"
- "tools/conanfile.py"
- "tools/generate_makevars.py"
- "R/**"
- "inst/extdata/**"
- "man/**"
- "src/**"
- "tests/**"
- ".Rbuildignore"
- "configure"
- "configure.win"
- "DESCRIPTION"
- "NAMESPACE"
tags:
- "v*.*.*"
pull_request:
branches: [main]
paths:
- ".github/workflows/pkgdown.yml"
- "tools/conanfile.py"
- "tools/generate_makevars.py"
- "R/**"
- "inst/extdata/**"
- "man/**"
- "src/**"
- "tests/**"
- ".Rbuildignore"
- "configure"
- "configure.win"
- "DESCRIPTION"
- "NAMESPACE"
release:
types: [published]
env:
HICTKR_CONAN_HOME: "${{ github.workspace }}/.conan2/"
CC: "gcc"
CXX: "g++"
jobs:
pkgdown:
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: Detect number of CPUs
run: |
echo "NPROC=$(nproc)" >> "$GITHUB_ENV"
echo "MAKE='make -j$(nproc)'" >> "$GITHUB_ENV"
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true
Ncpus: ${{ env.NPROC }}
- name: Restore Conan cache
uses: actions/cache@v4
id: restore-conan-cache
with:
key: conan-cache-pkgdown-${{ hashFiles( 'configure', 'tools/conanfile.py', 'tools/generate_makevars.py') }}
path: ${{ env.HICTKR_CONAN_HOME }}/p
- name: Add requirements
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website
- name: Setup Python
if: steps.restore-conan-cache.outputs.cache-hit != 'true'
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Clean Conan cache (post-build)
if: steps.restore-conan-cache.outputs.cache-hit != 'true'
run: |
pip install 'conan>=2'
export CONAN_HOME="$HICTKR_CONAN_HOME"
conan cache clean "*" --build
conan cache clean "*" --download
conan cache clean "*" --source
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.7.3
with:
clean: false
branch: gh-pages
folder: docs