Merge pull request #149 from mysense-ai/feat/serverlessUpgrade #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SSMPublish Workflow | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN_ADMIN_USER }} | |
jobs: | |
tests: | |
name: Tests and Coverage | |
strategy: | |
matrix: | |
version: [14.19.3, 16, 18, 19] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.version }} | |
registry-url: 'https://npm.pkg.github.com' | |
cache: 'yarn' | |
- name: Install packages | |
run: yarn install --frozen-lockfile | |
- name: Tests and coverage | |
run: | | |
yarn test:coverage | |
echo "Report Coverage..." | |
yarn codecov | |
publish: | |
name: Pubish Package | |
runs-on: ubuntu-20.04 | |
needs: tests | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN_ADMIN_USER }} | |
- name: Install packages | |
run: yarn install --frozen-lockfile | |
- name: Build and publish to NPM | |
run: | | |
echo "Building..." | |
yarn build:ci | |
echo "Deploying..." | |
yarn semantic-release |