23
23
group : pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
24
24
env :
25
25
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
26
- DELPHI_EPIDATA_KEY : ${{ secrets.DELPHI_GITHUB_ACTIONS_EPIDATA_API_KEY }}
26
+ DELPHI_EPIDATA_KEY : ${{ secrets.SECRET_EPIDATR_GHACTIONS_DELPHI_EPIDATA_KEY }}
27
27
steps :
28
28
- uses : actions/checkout@v3
29
29
@@ -35,19 +35,21 @@ jobs:
35
35
36
36
- uses : r-lib/actions/setup-r-dependencies@v2
37
37
with :
38
- extra-packages : any::pkgdown, local::.
38
+ extra-packages : any::pkgdown, local::., any::cli
39
39
needs : website
40
40
41
41
- name : Build site
42
- env :
43
- DELPHI_EPIDATA_KEY : ${{ secrets.SECRET_EPIDATR_GHACTIONS_DELPHI_EPIDATA_KEY }}
44
42
run : |
45
43
if (startsWith("${{ github.event_name }}", "pull_request")) {
46
- mode <- ifelse("${{ github.base_ref }}" == "main", "release", "devel")
44
+ mode_ref <- ifelse("${{ github.base_ref }}" == "main", "release", "devel")
47
45
} else {
48
- mode <- ifelse("${{ github.ref_name }}" == "main", "release", "devel")
46
+ mode_ref <- ifelse("${{ github.ref_name }}" == "main", "release", "devel")
49
47
}
50
- pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, override=list(PKGDOWN_DEV_MODE=mode))
48
+ pkg <- pkgdown::as_pkgdown(".", override = list(destination = ifelse(mode_ref == "release", "docs", "docs/dev"), PKGDOWN_DEV_MODE = mode_ref))
49
+ cli::cli_rule("Cleaning files from old site...")
50
+ pkgdown::clean_site(pkg)
51
+ pkgdown::build_site(pkg, preview = FALSE, install = FALSE, new_process = FALSE)
52
+ pkgdown:::build_github_pages(pkg)
51
53
shell : Rscript {0}
52
54
53
55
- name : Deploy to GitHub pages 🚀
0 commit comments