feb post prept #563
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * 0' | |
name: Build site | |
jobs: | |
render: | |
name: Build site | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install cURL Headers | |
run: | | |
sudo apt-get update | |
sudo apt-get install libcurl4-openssl-dev | |
- 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: 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.head_ref }}--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: | | |
npm install netlify-cli -g | |
netlify deploy --alias ${{ github.head_ref }} | |
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 | |