Skip to content

Commit 8133fa8

Browse files
committed
split up deploy for dev and stable, add workflow dispatch for main docu
1 parent 3643d74 commit 8133fa8

File tree

2 files changed

+109
-18
lines changed

2 files changed

+109
-18
lines changed

.github/workflows/deploy_docu.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Workflow based on https://github.com/r-lib/actions/blob/master/examples/pkgdown.yaml
22

3-
name: CI deploy documentation
3+
name: CI deploy documentation (stable)
44

55
on:
66
push:
@@ -75,14 +75,14 @@ jobs:
7575
- name: Build docu with pkgdown
7676
run: Rscript -e 'pkgdown::build_site(new_process = FALSE)'
7777

78-
- name: Deploy to dev
79-
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
78+
- name: Deploy to stable
79+
if: ${{ github.event_name == 'workflow_dispatch' }}
8080
uses: JamesIves/github-pages-deploy-action@v4
8181
with:
8282
repository-name: DoubleML/doubleml.github.io
8383
branch: main
8484
folder: docs/dev
85-
target-folder: r/dev
85+
target-folder: r/stable
8686
git-config-name: DoubleML Deploy Bot
8787
git-config-email: DoubleML@users.noreply.github.com
8888
clean: true
@@ -91,20 +91,7 @@ jobs:
9191
- name: Get tag
9292
run: echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV
9393

94-
- name: Deploy to version
95-
if: ${{ github.event_name == 'release' }}
96-
uses: JamesIves/github-pages-deploy-action@v4
97-
with:
98-
repository-name: DoubleML/doubleml.github.io
99-
branch: main
100-
folder: docs/dev
101-
target-folder: r/${{env.RELEASE_VERSION}}
102-
git-config-name: DoubleML Deploy Bot
103-
git-config-email: DoubleML@users.noreply.github.com
104-
clean: true
105-
ssh-key: ${{ secrets.DEPLOY_KEY }}
106-
107-
- name: Deploy to stable
94+
- name: Deploy to stable (release)
10895
if: ${{ github.event_name == 'release' }}
10996
uses: JamesIves/github-pages-deploy-action@v4
11097
with:
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Workflow based on https://github.com/r-lib/actions/blob/master/examples/pkgdown.yaml
2+
3+
name: CI deploy documentation (dev)
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
release:
11+
types:
12+
- published
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-20.04
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
persist-credentials: false
22+
- name: Install SSH Client
23+
uses: webfactory/ssh-agent@v0.7.0
24+
with:
25+
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
26+
27+
- name: Install R
28+
uses: r-lib/actions/setup-r@v2
29+
with:
30+
r-version: 'release'
31+
32+
- uses: r-lib/actions/setup-pandoc@v2
33+
34+
- name: Query dependencies
35+
run: |
36+
install.packages('remotes')
37+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
38+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
39+
shell: Rscript {0}
40+
41+
- name: Cache R packages
42+
uses: actions/cache@v3
43+
with:
44+
path: ${{ env.R_LIBS_USER }}
45+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
46+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
47+
48+
- name: Install system dependencies package
49+
run: |
50+
while read -r cmd
51+
do
52+
eval sudo $cmd
53+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
54+
55+
- name: Install system dependencies pkgdown
56+
run: |
57+
while read -r cmd
58+
do
59+
eval sudo $cmd
60+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04", package="pkgdown"))')
61+
62+
- name: Install additional system dependencies for pkgdown
63+
run: sudo apt-get install libharfbuzz-dev libfribidi-dev
64+
65+
- name: Install dependencies
66+
run: |
67+
remotes::install_deps(dependencies = TRUE)
68+
remotes::install_cran("pkgdown")
69+
shell: Rscript {0}
70+
71+
- name: Install package
72+
run: R CMD INSTALL .
73+
74+
- name: Build docu with pkgdown
75+
run: Rscript -e 'pkgdown::build_site(new_process = FALSE)'
76+
77+
- name: Deploy to dev
78+
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
79+
uses: JamesIves/github-pages-deploy-action@v4
80+
with:
81+
repository-name: DoubleML/doubleml.github.io
82+
branch: main
83+
folder: docs/dev
84+
target-folder: r/dev
85+
git-config-name: DoubleML Deploy Bot
86+
git-config-email: DoubleML@users.noreply.github.com
87+
clean: true
88+
ssh-key: ${{ secrets.DEPLOY_KEY }}
89+
90+
- name: Get tag
91+
run: echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV
92+
93+
- name: Deploy to version
94+
if: ${{ github.event_name == 'release' }}
95+
uses: JamesIves/github-pages-deploy-action@v4
96+
with:
97+
repository-name: DoubleML/doubleml.github.io
98+
branch: main
99+
folder: docs/dev
100+
target-folder: r/${{env.RELEASE_VERSION}}
101+
git-config-name: DoubleML Deploy Bot
102+
git-config-email: DoubleML@users.noreply.github.com
103+
clean: true
104+
ssh-key: ${{ secrets.DEPLOY_KEY }}

0 commit comments

Comments
 (0)