run workflow on master branch only #13
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: Test_and_Publish | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
name: Test Application | |
runs-on: ubuntu-latest | |
steps: | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 6.0.2 | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- run: pnpm install | |
- run: npm test | |
- name: "Upload coverage to Codecov" | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
file: ./coverage/lcov.info | |
fail_ci_if_error: true | |
verbose: true | |
- run: npm run build | |
- name: "Publish to NPM" | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
access: "public" | |
- name: "Create the docs directory locally in CI" | |
run: npx typedoc src/index.ts | |
- name: "Deploy 🚀" | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: docs |