Skip to content

Commit cec9d5a

Browse files
authored
Merge pull request #706 from cmu-delphi/krivard/blog-workflow
Get blog workflow to work again
2 parents c4c63d2 + a956621 commit cec9d5a

File tree

4 files changed

+35
-26
lines changed

4 files changed

+35
-26
lines changed

.github/workflows/blog.yaml

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,50 @@ on:
77
- "environment.yml"
88
- "dependencies.R"
99
- ".github/workflows/blog.yaml"
10+
workflow_dispatch:
1011

1112
jobs:
1213
blog:
1314
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
shell: bash -l {0}
18+
env:
19+
RETICULATE_PYTHON: /usr/share/miniconda3/envs/www-main/bin/python
1420
steps:
1521
- uses: actions/checkout@v3
1622
with:
1723
# submodules: true # Fetch Hugo themes (true OR recursive)
1824
fetch-depth: 3
19-
- name: Cache Conda
20-
uses: actions/[email protected]
21-
with:
22-
path: ~/conda_pkgs_dir
23-
key: ${{ runner.os }}-conda6-${{ hashFiles('environment.yml') }}
24-
restore-keys: |
25-
${{ runner.os }}-conda6-
2625
- uses: conda-incubator/setup-miniconda@v2
2726
with:
2827
python-version: 3.9
29-
mamba-version: "*"
30-
channels: conda-forge,defaults
31-
channel-priority: true
3228
activate-environment: www-main
33-
environment-file: environment.yml
34-
auto-activate-base: false
29+
miniforge-variant: Mambaforge
30+
miniforge-version: latest
31+
use-mamba: true
3532
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
36-
# - name: Conda info
37-
# shell: bash -l {0}
38-
# run: |
39-
# conda info
40-
# conda list
33+
- name: Get Date
34+
id: get-date
35+
run: echo "name=today::$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
36+
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
50+
run: |
51+
conda info
52+
conda list
4153
- name: Install R dependencies
42-
shell: bash -l {0}
4354
env:
4455
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
4556
run: |
@@ -54,10 +65,8 @@ jobs:
5465
${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-
5566
${{ runner.os }}-blogdown2-
5667
- name: Build site
57-
shell: bash -l {0}
5868
run: |
5969
npm run build:blog
60-
6170
- uses: actions/upload-artifact@v3
6271
with:
6372
name: blog
@@ -79,7 +88,6 @@ jobs:
7988
run: npm run lint
8089
- name: Build
8190
run: npm run build
82-
8391
- uses: actions/upload-artifact@v3
8492
with:
8593
name: website

content/blog/2021-01-22-holiday-surveys.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ regionmap <- travel %>%
108108
filter(geo_value %in% str_to_lower(statelist)) %>%
109109
mutate(value = plyr::mapvalues(geo_value, str_to_lower(statelist), regions),
110110
value = as.integer(factor(value)))
111-
111+
attr(regionmap, "metadata") <- list(geo_type = "state")
112112
grid_label <- textGrob("Data from Delphi COVIDcast, delphi.cmu.edu",
113113
hjust = 1, x = 1, gp = gpar(fontsize = 9))
114114

dependencies.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ install.packages("covidcast", repo="http://cran.rstudio.com/")
88
# upgrade = 'never',
99
# subdir = "R-packages/covidcast")
1010

11-
devtools::install_github("reichlab/zoltr", upgrade = 'never', quick = TRUE)
12-
devtools::install_github("reichlab/covidData", upgrade = 'never', quick = TRUE)
13-
devtools::install_github("reichlab/covidHubUtils", upgrade = 'never', quick = TRUE)
11+
devtools::install_github("reichlab/zoltr", upgrade = 'never')
12+
devtools::install_github("reichlab/covidData", upgrade = 'never')
13+
devtools::install_github("reichlab/covidHubUtils", upgrade = 'never')

environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- gdal
77
- python=3.9.1
88
- pip
9-
- r-base=3.6.3
9+
- r-base
1010
- glib
1111
- mscorefonts
1212
- r-cairo
@@ -50,6 +50,7 @@ dependencies:
5050
- r-vroom
5151
- r-urltools
5252
- r-base64url
53+
- r-readr >=2
5354
- pandoc
5455
- fiona
5556
- geopandas

0 commit comments

Comments
 (0)