Update README.md #79
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: Main 🧠 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Build | |
run: | | |
npm install | |
npm run build | |
- name: Test | |
run: | | |
npm run test | |
- name: Generate docs | |
run: | | |
npm run doc | |
- name: Publish docs | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: docs | |
- name: Publish to NPM | |
uses: JS-DevTools/npm-publish@v1 | |
id: publish | |
if: ${{ env.deployment_status != 'failed' }} | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
- name: Get changes from changelog | |
if: ${{ steps.publish.outputs.type != 'none' }} | |
run: | | |
chmod +x scripts/getChange.sh | |
./scripts/getChange.sh ${{steps.publish.outputs.version}} CHANGELOG.md > CHANGELOG.txt | |
- name: Release on GitHub | |
uses: softprops/action-gh-release@v1 | |
if: ${{ steps.publish.outputs.type != 'none' }} | |
with: | |
body_path: CHANGELOG.txt | |
files: build/* | |
tag_name: ${{steps.publish.outputs.version}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |