-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (58 loc) · 1.67 KB
/
blog.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
name: blog
on:
push:
paths: # run only when an Rmd file changes
- "**.Rmd"
- "environment.yml"
- "dependencies.R"
- ".github/workflows/blog.yaml"
workflow_dispatch:
jobs:
blog:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 3
- uses: mamba-org/provision-with-micromamba@v16
with:
environment-file: environment.yml
micromamba-version: latest
- name: Get Date
id: get-date
run: echo "name=today::$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Create environment
run: micromamba env create -n www-main-micromamba -f environment.yml
- name: micromamba info
run: |
micromamba info
micromamba list
- name: Install R dependencies
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
Rscript ./dependencies.R
- name: Restore Blogdown Cache
uses: actions/[email protected]
with:
path: |
./blogdown
key: ${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-${{ hashFiles('content/blog/**.Rmd') }}
restore-keys: |
${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-
${{ runner.os }}-blogdown2-
- name: Build site
env:
API_KEY: ${{ secrets.DELPHI_GITHUB_ACTIONS_EPIDATA_API_KEY }}
run: |
npm run build:blog
- uses: actions/upload-artifact@v3
with:
name: blog
path: |
./content/blog
./static/blog