Skip to content

Commit 81b9486

Browse files
ci: add github actions for test, build and deploy (#347)
* ci: add test github action on push * ci: fix incorrect worksflows path * ci: fix syntax error in test action * ci: add test and build action for pull requests * ci: add github action to deploy on openscd.github.io
1 parent 0298ac5 commit 81b9486

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build and Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
14+
- name: Use Node.js 14.x
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: '14.x'
18+
19+
- name: Install and Build
20+
run: |
21+
npm ci
22+
npm run-script build
23+
24+
- name: Deploy
25+
uses: JamesIves/[email protected]
26+
with:
27+
branch: master
28+
folder: build
29+
repository-name: openscd/openscd.github.io
30+
ssh-key: ${{ secrets.DEPLOY_KEY }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Test and Build
2+
on: pull_request
3+
4+
jobs:
5+
test-and-build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/[email protected]
10+
11+
- name: Use Node.js 14.x
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: '14.x'
15+
16+
- name: Install and Build
17+
run: |
18+
npm ci
19+
npm run-script build

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
14+
- name: Use Node.js 14.x
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: '14.x'
18+
19+
- name: Install and Test
20+
run: |
21+
npm ci
22+
npm run-script test

0 commit comments

Comments
 (0)