-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add main.yml GitHub Action for the CI/CD of the package Signed-off-by: Niloy Sikdar <[email protected]>
- Loading branch information
1 parent
4930221
commit f67a748
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Check, Build & Publish Package | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: '*' | ||
|
||
jobs: | ||
check-and-build: | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
os: [ubuntu-latest] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v2 | ||
- name: Install, check, test, and build using Node.js ${{ matrix.node-version }} ⚙️ | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: yarn | ||
- run: yarn lint | ||
- run: yarn pretty | ||
- run: yarn build | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
needs: [check-and-build] | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v2 | ||
- name: Deploy and Publish package using Node.js ${{ matrix.node-version }} 🚀 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: yarn | ||
- run: yarn build | ||
- run: yarn release |