Skip to content

Commit

Permalink
feat(.github): add deploy job
Browse files Browse the repository at this point in the history
  • Loading branch information
Abod-Akhras committed Oct 20, 2021
1 parent 93d8027 commit bdbdf66
Show file tree
Hide file tree
Showing 4 changed files with 7,291 additions and 2,132 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node and then publish the new bundle to NPM

name: Publish CD


on:
workflow_dispatch:

jobs:
quality:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test

publish:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
needs: [quality]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_APIKEY }}
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_API_KEY }}
28 changes: 28 additions & 0 deletions .github/workflows/quality.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node

name: Quality CI

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

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- run: npm install
- run: npm install -g codecov
- run: npm run coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit bdbdf66

Please sign in to comment.