1
1
name : blog
2
-
3
2
on :
4
3
push :
5
4
paths : # run only when an Rmd file changes
8
7
- " dependencies.R"
9
8
- " .github/workflows/blog.yaml"
10
9
workflow_dispatch :
11
-
12
10
jobs :
13
11
blog :
14
12
runs-on : ubuntu-latest
15
13
defaults :
16
14
run :
17
15
shell : bash -l {0}
18
- env :
19
- RETICULATE_PYTHON : /usr/share/miniconda3/envs/www-main/bin/python
20
16
steps :
21
17
- uses : actions/checkout@v3
22
18
with :
23
- # submodules: true # Fetch Hugo themes (true OR recursive)
24
19
fetch-depth : 3
25
- - uses : conda-incubator/setup-miniconda@v2
20
+ - uses : mamba-org/provision-with-micromamba@v15
26
21
with :
27
- python-version : 3.9
28
- activate-environment : www-main
29
- miniforge-variant : Mambaforge
30
- miniforge-version : latest
31
- use-mamba : true
32
- use-only-tar-bz2 : true # IMPORTANT: This needs to be set for caching to work properly!
22
+ environment-file : environment.yml
23
+ micromamba-version : latest
33
24
- name : Get Date
34
25
id : get-date
35
26
run : echo "name=today::$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
36
27
shell : bash
37
- - name : Cache Conda env
38
- uses : actions/cache@v3
39
- with :
40
- path : ${{ env.CONDA }}/envs
41
- key : conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }}
42
- env :
43
- # Increase this value to reset cache if etc/example-environment.yml has not changed
44
- CACHE_NUMBER : 0
45
- id : cache
46
- - name : Update environment
47
- run : mamba env update -n www-main -f environment.yml
48
- if : steps.cache.outputs.cache-hit != 'true'
49
- - name : Conda info
28
+ - name : Create environment
29
+ run : micromamba env create -n www-main-micromamba -f environment.yml
30
+ - name : micromamba info
50
31
run : |
51
- conda info
52
- conda list
32
+ micromamba info
33
+ micromamba list
53
34
- name : Install R dependencies
54
35
env :
55
36
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
72
53
name : blog
73
54
path : |
74
55
./content/blog
75
- ./static/blog
76
-
77
- - uses : actions/setup-node@v3
78
- with :
79
- node-version : 16
80
-
81
- with :
82
- path : ~/.npm
83
- key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
84
- restore-keys : |
85
- ${{ runner.os }}-node-
86
- - run : npm ci
87
- - name : Lint
88
- run : npm run lint
89
- - name : Build
90
- run : npm run build
91
- - uses : actions/upload-artifact@v3
92
- with :
93
- name : website
94
- path : ./public
56
+ ./static/blog
0 commit comments