-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (55 loc) · 1.94 KB
/
master.yml
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
name: Run Crypto Tutorial
on:
schedule:
- cron: '35 00,12 * * *'
jobs:
build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v1
with:
r-version: '4.0.3'
crayon.enabled: 'FALSE'
- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-tinytex@v1
- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3-
- name: Install Packages
run: |-
Rscript -e "install.packages('renv')"
Rscript -e "install.packages('fastmap')"
Rscript -e 'renv::consent(provided = TRUE)'
Rscript -e "renv::restore()"
Rscript -e "update.packages('fastmap')"
Rscript -e "install.packages('bookdown', dependencies = TRUE)"
- name: Refresh book
run: |
pins_key <- "${{secrets.PAT_PINS}}"
bookdown::render_book('0-Introduction.Rmd', clean = TRUE)
shell: Rscript {0}
- name: Snapshot renv to update lockfile
run: |-
Rscript -e "renv::snapshot()"
- name: Add website front page
working-directory: ./
run: |
ls
cp index.html _book
cp about-us.html _book
cp tools.html _book
- name: Update GitHub page
run: |
rm -r docs
cp -R _book docs
- name: Commit and push files
run: |
git config --local user.email "[email protected]"
git config --local user.name "ries9112"
git add .
git commit -m "Refresh entire book from CI automated process" -a
git push https://ries9112:${{secrets.GITHUB_TOKEN}}@github.com/ries9112/cryptocurrencyresearch-org.git HEAD:master --force