Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Setup CI-CD using Github Actions #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/node.js-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need 3 version of node?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh, that was just the default template I used for Github Actions which I presume was test oriented. We can make do with just 1


steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Build Gatsby site
run: npm run build --if-present
- name: Deploy to fabricjs.github.io
run: npm run deploy --if-present
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
145 changes: 144 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
"version": "0.1.0",
"license": "MIT",
"keywords": [
"fabricjs"
],
"fabricjs"
],
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
"start": "npm run develop",
"serve": "gatsby serve",
"clean": "gatsby clean",
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1",
"deploy": "gh-pages -d public -r https://[email protected]/fabricjs/fabricjs.github.io.git -b gh-pages"
},
"dependencies": {
"gatsby": "^2.19.7",
Expand All @@ -31,6 +32,7 @@
"react-helmet": "^5.2.1"
},
"devDependencies": {
"gh-pages": "^3.0.0",
"prettier": "^1.19.1"
},
"homepage": "https://github.com/fabricjs/fabricjs-website",
Expand Down