Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get blog workflow to work again #706

Merged
merged 3 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions .github/workflows/blog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,50 @@ on:
- "environment.yml"
- "dependencies.R"
- ".github/workflows/blog.yaml"
workflow_dispatch:

jobs:
blog:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
RETICULATE_PYTHON: /usr/share/miniconda3/envs/www-main/bin/python
steps:
- uses: actions/checkout@v3
with:
# submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 3
- name: Cache Conda
uses: actions/cache@v3.0.2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda6-${{ hashFiles('environment.yml') }}
restore-keys: |
${{ runner.os }}-conda6-
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: www-main
environment-file: environment.yml
auto-activate-base: false
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
# - name: Conda info
# shell: bash -l {0}
# run: |
# conda info
# conda list
- name: Get Date
id: get-date
run: echo "name=today::$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run: mamba env update -n www-main -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Conda info
run: |
conda info
conda list
- name: Install R dependencies
shell: bash -l {0}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -54,10 +65,8 @@ jobs:
${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-
${{ runner.os }}-blogdown2-
- name: Build site
shell: bash -l {0}
run: |
npm run build:blog

- uses: actions/upload-artifact@v3
with:
name: blog
Expand All @@ -79,7 +88,6 @@ jobs:
run: npm run lint
- name: Build
run: npm run build

- uses: actions/upload-artifact@v3
with:
name: website
Expand Down
2 changes: 1 addition & 1 deletion content/blog/2021-01-22-holiday-surveys.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ regionmap <- travel %>%
filter(geo_value %in% str_to_lower(statelist)) %>%
mutate(value = plyr::mapvalues(geo_value, str_to_lower(statelist), regions),
value = as.integer(factor(value)))

attr(regionmap, "metadata") <- list(geo_type = "state")
grid_label <- textGrob("Data from Delphi COVIDcast, delphi.cmu.edu",
hjust = 1, x = 1, gp = gpar(fontsize = 9))

Expand Down
6 changes: 3 additions & 3 deletions dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ install.packages("covidcast", repo="http://cran.rstudio.com/")
# upgrade = 'never',
# subdir = "R-packages/covidcast")

devtools::install_github("reichlab/zoltr", upgrade = 'never', quick = TRUE)
devtools::install_github("reichlab/covidData", upgrade = 'never', quick = TRUE)
devtools::install_github("reichlab/covidHubUtils", upgrade = 'never', quick = TRUE)
devtools::install_github("reichlab/zoltr", upgrade = 'never')
devtools::install_github("reichlab/covidData", upgrade = 'never')
devtools::install_github("reichlab/covidHubUtils", upgrade = 'never')
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- gdal
- python=3.9.1
- pip
- r-base=3.6.3
- r-base
- glib
- mscorefonts
- r-cairo
Expand Down Expand Up @@ -50,6 +50,7 @@ dependencies:
- r-vroom
- r-urltools
- r-base64url
- r-readr >=2
- pandoc
- fiona
- geopandas
Expand Down