1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-04-17 10:08:43 -04:00

simple test builds via GitHub Action

This commit is contained in:
2019-12-04 11:25:42 -05:00
parent 96ad258d36
commit 1747bdd149
2 changed files with 48 additions and 6 deletions

41
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Build Hugo
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
lfs: false
- uses: actions/setup-node@v1
with:
node-version: "12.x"
# https://github.com/actions/cache/blob/master/examples.md#node---yarn
# https://github.com/actions/cache/issues/60
- name: Get yarn cache location
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --no-ignore-optional --frozen-lockfile
- run: yarn hugo:version
- run: yarn build:preview
- uses: actions/upload-artifact@master
if: github.event_name == 'pull_request'
with:
name: public
path: './public'