Skip to content

skip rendering cv

skip rendering cv #514

Workflow file for this run

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: '0 0 * * 0'
name: Build site
jobs:
render:
name: Build site
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get Hugo version
id: hugo_vr
run: |
ver=$(cat .Rprofile | grep hugo.version | cut -d'"' -f2 )
echo ".Rprofile sets hugo version to $ver"
echo "hugo_v=${ver}" >> $GITHUB_ENV
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.hugo_v }}
extended: true
- name: Install npm dependencies
run: npm install
- name: Install Netlify CLI
if: github.event_name == 'pull_request'
run: brew install netlify-cli
#
# - name: Setup R
# if: github.ref == 'refs/heads/main'
# uses: r-lib/actions/setup-r@v2
# timeout-minutes: 60
#
# - name: Get R packages
# if: github.ref == 'refs/heads/main'
# uses: r-lib/actions/setup-renv@v2
#
# - name: Setup pandoc
# if: github.ref == 'refs/heads/main'
# uses: r-lib/actions/setup-pandoc@v2
# with:
# pandoc-version: '2.12'
#
# - name: Install tinytex
# if: github.ref == 'refs/heads/main'
# uses: r-lib/actions/setup-tinytex@v2
#
# - name: Cache node modules
# id: cache-npm
# uses: actions/cache@v3
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
#
#
# - name: Render about me & cv
# if: github.ref == 'refs/heads/main'
# run: |
# blogdown::build_site(local = FALSE,
# run_hugo = FALSE,
# build_rmd = "content/about/_index.Rmd")
# rmarkdown::render("content/about/resume/am_mowinckel_cv.Rmd")
# shell: Rscript {0}
# env:
# ORCID_TOKEN: ${{ secrets.ORCID_TOKEN }}
- name: Build
run: |
if [[ '${{github.ref}}' == 'refs/heads/main' ]]; then
hugo -e production
else
hugo -b https://${{ github.sha }}--drmowinckels.netlify.app/
fi
- name: Deploy production 🚀
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: public
- name: Deploy to Netlify
if: github.event_name == 'pull_request'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
run: |
echo "Running netlify preview deploy"
netlify deploy --alias ${{ github.sha }}
shell: sh
#
# - name: Send to rweekly
# if: github.event_name == 'push'
# run: |
# files=$(jack --name-only HEAD~30..HEAD content/blog/)
# Rscript R/rweekly.R files