mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
ci: add JS linter, code formatter, and fix Hugo working dir
This commit is contained in:
parent
d18b2c9def
commit
095cd1e691
1 changed files with 50 additions and 3 deletions
53
.github/workflows/build-test-site.yaml
vendored
53
.github/workflows/build-test-site.yaml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: build test site
|
name: Continuous Integration
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -13,8 +13,54 @@ on:
|
||||||
- 'wowchemy/**'
|
- 'wowchemy/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
node-version: [15.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true # Fetch any Git submodules (true OR recursive)
|
||||||
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||||
|
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
- name: Install JS dependencies
|
||||||
|
run: npm ci
|
||||||
|
working-directory: ./wowchemy
|
||||||
|
|
||||||
|
- name: Check for JS linting errors
|
||||||
|
run: npm lint:js
|
||||||
|
working-directory: ./wowchemy
|
||||||
|
|
||||||
|
format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
# Make sure the actual branch is checked out when running on pull requests
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
|
||||||
|
- name: Prettify code
|
||||||
|
uses: creyD/prettier_action@v3.1
|
||||||
|
with:
|
||||||
|
prettier_options: '--write "wowchemy/*.{css,js,json,md,scss}" "wowchemy/**/*.{css,js,json,md,scss}"' # Match package.json
|
||||||
|
prettier_version: '2.2.1' # Match package.json
|
||||||
|
commit_message: 'refactor: format code'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
hugo:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
@ -29,3 +75,4 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
|
working-directory: ./wowchemy/test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue