Skip to content
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
27 changes: 12 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,22 @@ jobs:
- name: Build site
shell: bash -l {0}
run: |
Rscript -e 'blogdown::build_site(run_hugo=FALSE, build_rmd=TRUE)'

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
npm run build:blog

- uses: actions/setup-node@v1
with:
hugo-version: '0.78.0'
extended: true

node-version: '12'
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Build
run: hugo --minify
run: npm run build

- uses: actions/upload-artifact@v2
with:
name: website
path: ./public

- name: Deploy Main
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./public

24 changes: 11 additions & 13 deletions .github/workflows/ci_fast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,21 @@ jobs:
with:
# submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 3 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2

- uses: actions/setup-node@v1
with:
hugo-version: '0.78.0'
extended: true

node-version: '12'
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Build
run: hugo --minify
run: npm run build

- uses: actions/upload-artifact@v2
with:
name: website
path: ./public

- name: Deploy Main
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./public

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
*_cache
/content/**/*_files
*.lock~
/content/blog/_output.yml
/content/blog/_output.yml
/node_modules
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ This site is based on [Hugo](https://gohugo.io).

### Web Editor Only

1. Install Hugo: https://gohugo.io/getting-started/installing/ -> install the **extended** version.
1. Install Node: https://nodejs.org/en/download/
1. Run `npm install`

#### Commands

1. run `hugo server` to create a development server
1. run `hugo server -D` to create a development server which also renders draft pages, see [Draft](https://gohugo.io/getting-started/usage/#draft-future-and-expired-content)
1. run `hugo --minify` to build a minified build in `/public`
1. run `npm start` to create a development Hugo server
1. run `npm build` to build a minified build in `/public`

### Blog Editor

Expand All @@ -34,7 +34,7 @@ In order to convert the Rmd files to HTML files for Hugo you also need to:
#### Commands

1. Activate the environment: `conda activate www-main`
1. Run blogdown to convert the files to HTML: `Rscript -e 'blogdown::build_site(local=TRUE, run_hugo=FALSE)'`
1. Run blogdown to convert the files to HTML: `Rscript -e 'blogdown::build_site(local=TRUE, run_hugo=FALSE, build_rmd=TRUE)'`
- `local=TRUE` similar to `-D` to process draft files
- `run_hugo=FALSE` to manually run hugo
- `build_rmd=TRUE` force a (re)build of the Rmd pages
Expand Down
Loading