-
Notifications
You must be signed in to change notification settings - Fork 79
74 lines (65 loc) · 2.29 KB
/
update_books_infos.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
on:
workflow_dispatch:
schedule:
- cron: '45 5 * * 4'
name: Update books infos
jobs:
create_md:
name: fetch updated info
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RENV_PATHS_ROOT: ~/.local/share/renv
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
id: install-r
with:
r-version: '4.1.1'
use-public-rspm: true
- name: Cache Renv packages
uses: actions/cache@v4
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-1-${{ hashFiles('R/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-1-
${{ runner.os }}-renv-
- name: Install packages
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore(repos = "https://packagemanager.rstudio.com/all/latest")
shell: Rscript {0}
working-directory: R/
- name: Update books
env:
RSC_BOOKDOWN_ORG_TOKEN: ${{ secrets.RSC_BOOKDOWN_ORG_TOKEN }}
PINS_VERBOSE: true
LOGGER_LOG_LEVEL: ${{ secrets.LOGGER_LOG_LEVEL }}
run: Rscript create-md.R
working-directory: R/
- uses: actions/upload-artifact@v4
with:
name: saved_books_metas
path: '**/saved_books_metas.rds'
retention-days: 7
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
new book updates [auto PR]
branch: updates/gha-auto
delete-branch: true
reviewers: cderv
title: |
Books meta updates
body: |
This PR was created automatically with new book updates.
Please review and merge to trigger a new build of the website.
- name: Check auto PR outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
echo "Pull Request Action Performed - ${{ steps.cpr.outputs.pull-request-operation }}"