mirror of
https://github.com/kremalicious/blog.git
synced 2025-01-23 08:14:09 +01:00
setup GitHub Action
This commit is contained in:
parent
578d355455
commit
9c8e4e44ee
67
.github/workflows/ci.yml
vendored
Normal file
67
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
name: 'CI'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '15'
|
||||
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: ${{ runner.os }}-node-
|
||||
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
- uses: paambaati/codeclimate-action@v2.7.5
|
||||
env:
|
||||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '15'
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: ${{ runner.os }}-node-
|
||||
|
||||
- name: Cache Gatsby Cache Folder
|
||||
uses: actions/cache@v1
|
||||
id: gatsby-cache-folder
|
||||
with:
|
||||
path: .cache
|
||||
key: ${{ runner.os }}-cache-gatsby
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cache-gatsby
|
||||
|
||||
- name: Cache Gatsby Public Folder
|
||||
uses: actions/cache@v1
|
||||
id: gatsby-public-folder
|
||||
with:
|
||||
path: public/
|
||||
key: ${{ runner.os }}-public-gatsby
|
||||
restore-keys: |
|
||||
${{ runner.os }}-public-gatsby
|
||||
|
||||
- run: npm ci
|
||||
- run: npm run build
|
Loading…
Reference in New Issue
Block a user