Skip to content

Commit 33bd037

Browse files
committed
add _pkgdown.yml and GHA deployment
0 parents  commit 33bd037

2 files changed

Lines changed: 101 additions & 0 deletions

File tree

.github/workflows/pr_check.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: PR CMD check & build site
2+
3+
on:
4+
push:
5+
paths:
6+
- 'DESCRIPTION'
7+
- '**.yml'
8+
branches:
9+
- RELEASE_3_21
10+
- pkgdown
11+
12+
env:
13+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
CRAN: https://p3m.dev/cran/__linux__/noble/latest
16+
BIOC_RELEASE: RELEASE_3_21
17+
18+
jobs:
19+
check:
20+
runs-on: ubuntu-latest
21+
container: bioconductor/bioconductor_docker:RELEASE_3_21
22+
23+
steps:
24+
- name: Checkout Repository
25+
uses: actions/checkout@v4
26+
with:
27+
ref: ${{ env.BIOC_RELEASE }}
28+
29+
- name: Copy .github and _pkgdown.yml
30+
run: |
31+
git fetch origin pkgdown
32+
git checkout origin/pkgdown -- .github
33+
git checkout origin/pkgdown -- _pkgdown.yml
34+
35+
- name: Query dependencies
36+
run: |
37+
BiocManager::install(c("covr", "BiocCheck"))
38+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
39+
shell: Rscript {0}
40+
41+
- name: Cache R packages
42+
uses: actions/cache@v4
43+
with:
44+
path: /usr/local/lib/R/site-library
45+
key: ${{ runner.os }}-r-${{ env.BIOC_RELEASE }}-${{ hashFiles('.github/depends.Rds') }}
46+
restore-keys: ${{ runner.os }}-r-${{ env.BIOC_RELEASE }}-
47+
48+
- name: Install GPG
49+
if: ${{ github.ref == 'refs/heads/devel' && github.event_name != 'pull_request' }}
50+
run: sudo apt-get update && sudo apt-get install -y gpg
51+
52+
- name: Install Dependencies
53+
run: |
54+
remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories())
55+
BiocManager::install(c("rcmdcheck", "BiocCheck"), ask = FALSE, update = TRUE)
56+
shell: Rscript {0}
57+
58+
- name: Check Package
59+
env:
60+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
61+
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error", check_dir = "check")
62+
shell: Rscript {0}
63+
64+
- name: Run BiocCheck
65+
id: bioccheck
66+
run: |
67+
BiocCheck::BiocCheck(
68+
dir('check', 'tar.gz$', full.names = TRUE),
69+
`quit-with-status` = TRUE, `no-check-bioc-help` = TRUE
70+
)
71+
shell: Rscript {0}
72+
73+
- name: Build pkgdown
74+
run: |
75+
PATH=$PATH:$HOME/bin/ Rscript -e 'pkgdown::build_site()'
76+
77+
- name: Upload pkgdown artifact
78+
uses: actions/upload-pages-artifact@v3
79+
with:
80+
path: docs
81+
82+
deploy:
83+
needs: check
84+
permissions:
85+
contents: write
86+
pages: write
87+
id-token: write
88+
runs-on: ubuntu-24.04
89+
90+
steps:
91+
- name: Deploy to GitHub Pages
92+
id: deployment
93+
uses: actions/deploy-pages@v4
94+

_pkgdown.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: AnnotationHub
2+
url: https://waldronlab.github.io/AnnotationHub
3+
4+
template:
5+
bootstrap: 5
6+
params:
7+
bootswatch: flatly

0 commit comments

Comments
 (0)