Skip to content

Commit

Permalink
ci: add github actions for test, build and deploy (#347)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
JakobVogelsang committed Nov 2, 2021
1 parent 0298ac5 commit 81b9486
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Deploy
on:
push:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.1

- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '14.x'

- name: Install and Build
run: |
npm ci
npm run-script build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: master
folder: build
repository-name: openscd/openscd.github.io
ssh-key: ${{ secrets.DEPLOY_KEY }}
19 changes: 19 additions & 0 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test and Build
on: pull_request

jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.1

- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '14.x'

- name: Install and Build
run: |
npm ci
npm run-script build
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test
on:
push:
branches-ignore:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.1

- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '14.x'

- name: Install and Test
run: |
npm ci
npm run-script test

0 comments on commit 81b9486

Please sign in to comment.