add banner #31
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: Build and Deploy | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- '*' # This will trigger the workflow on any tag push | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' # Specify your Node.js version here | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Upload Docs Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: public | |
path: public/ | |
- name: Upload Lib Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist/ | |
verify: | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' # Specify your Node.js version here | |
- name: Install Dependencies | |
run: npm install | |
- name: Lint | |
run: npm run lint | |
publish-npm: | |
needs: [build, verify] | |
runs-on: ubuntu-latest | |
continue-on-error: false | |
if: startsWith(github.ref, 'refs/tags/') # This ensures the job only runs for tag pushes | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' # Specify your Node.js version here | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- run: npm run build | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
deploy-docs: | |
name: 'Deploy to Netlify' | |
runs-on: ubuntu-latest | |
needs: [build, verify] | |
if: github.ref == 'refs/heads/master' # This ensures the job only runs for pushes to master | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' # Specify your Node.js version here | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- uses: jsmrcaga/[email protected] | |
with: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_DEPLOY_TO_PROD: true | |
build_directory: public |