Merge pull request #214 from d-velop/develop #82
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: release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish-release: | |
if: "github.repository == 'd-velop/dvelop-sdk-node'" | |
name: Publish to npm as latest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Run build | |
run: npm run build | |
- name: Set release credentials | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Tag packages as latest on npm | |
run: npm run publish:latest | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
release-docs: | |
name: release documentation | |
runs-on: ubuntu-latest | |
needs: publish-release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Build packages | |
run: npm run build | |
- name: Generate docs | |
run: npm run docs | |
- name: Commit docs to gh-pages | |
uses: JamesIves/github-pages-deploy-action@4.1.0 | |
with: | |
branch: gh-pages | |
folder: docs |