refactor: initRole logic #644
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: Push to master | |
on: | |
push: | |
branches: | |
- master | |
- next | |
tags-ignore: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Setup node' | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Build library' | |
run: npm run build | |
- name: 'Upload dist folder' | |
uses: actions/upload-artifact@v4.3.1 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: dist/canopy/ | |
overwrite: true | |
release: | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Setup node' | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Download dist folder' | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: dist/canopy/ | |
- name: 'Zip library' | |
run: zip -r dist/canopy.zip dist/canopy | |
- name: 'Release' | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
needs: [ build ] | |
if: github.ref_name == 'master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Setup node' | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Download dist folder' | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: dist/canopy/ | |
- name: 'Deployment to GitHub Pages' | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const deployBranch = require('./.github/workflow-scripts/gh-pages/deploy.js'); | |
await deployBranch({ | |
branch: 'master', | |
sha: '${{ github.sha }}', | |
github, | |
context, | |
exec, | |
core | |
}); |