-
Notifications
You must be signed in to change notification settings - Fork 3
143 lines (123 loc) · 4.15 KB
/
build-deploy-rmd.yaml
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
139
140
141
142
143
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 9 * * 3'
workflow_dispatch:
name: build-deploy-rmd
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# permissions:
# contents: read
# pages: write
# id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
# concurrency:
# group: "pages"
# cancel-in-progress: false
jobs:
build-rmd:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
CRAN: ${{ matrix.config.cran }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out repo
uses: actions/checkout@v2
with:
submodules: true
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- name: Set up pandoc
uses: r-lib/actions/setup-pandoc@v2
## rcrossref requires an email address associated with a query
- name: Set up crossref email
run: |
echo crossref_email=\"${{ secrets.CROSSREF_EMAIL }}\" >> ~/.Renviron
- name: Install dependencies
run: |
install.packages(c('remotes', 'dplyr', 'ggplot2', 'rmarkdown',
'knitr', 'tibble', 'tidyr',
'lubridate', 'gh', 'jsonlite', 'purrr',
'DT', 'plotly', 'citecorp', 'readr',
'viridis', 'wordcloud', 'stringr', 'gt',
'rworldmap', 'openalexR'), Ncpu = 2L)
remotes::install_github('ropensci/rcrossref')
shell: Rscript {0}
- name: Session info
run: |
install.packages('sessioninfo', Ncpus = 2L)
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Render site
run: |
rmarkdown::render(input = "joss-submission-analytics.Rmd", clean = FALSE)
shell: Rscript {0}
- name: Prepare files to deploy
run: |
mkdir _site
touch _site/.nojekyll
cp -r joss-submission-analytics_files joss-submission-analytics.html _site/
cp -r joss_submission_analytics.rds _site/
cp -r joss_submission_citations_byjournal.tsv _site/
cp -r joss_submission_citations.tsv _site/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: _site
- name: Upload check results
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: submissionanalytics
path: joss_submission_analytics.rds
## From 2024-06-30, need to use GitHub Actions for deployment
# - name: Setup Pages
# uses: actions/configure-pages@v5
#
# - name: Build with Jekyll
# uses: actions/jekyll-build-pages@v1
# with:
# source: ./_site
# destination: ./_site_jkl
#
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v3
# with:
# path: ./_site_jkl
# Deployment job
# deploy:
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# runs-on: ubuntu-latest
# needs: build-rmd
#
# steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4