Merge pull request #21 from ayushanand18/add-npm-badge #12
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: NPM publish + GH Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '14.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: git config user.email "[email protected]" && git config user.name "Arran White" | |
- name: Install dependencies | |
run: npm ci | |
- name: Build library | |
run: npm run build | |
- name: Generate changelog + tag | |
run: npm run release | |
- name: Commit changelog | |
run: git push --follow-tags origin main | |
- name: Publish on NPM | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Build demo site | |
run: npm run build-demo | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./demo_dist |