fix build docs #71
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: Build and publish BLE library | |
on: | |
push: | |
branches: | |
- master | |
- hotfix/* | |
jobs: | |
library: | |
name: Build and publish ble library | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@iotinga' | |
- name: Bump version and push tag | |
uses: anothrNick/[email protected] | |
id: version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DEFAULT_BUMP: patch | |
- name: Copy readme file to package directory (npm doesn't support symlinks!) | |
run: cp README.md library/ | |
- name: Bump version | |
working-directory: library/ | |
run: npm version ${{ steps.version.outputs.new_tag }} | |
- name: Commit new version | |
continue-on-error: true | |
run: git commit -am "[CI] bump version to $IOTINGA_VERSION" && git push | |
- name: Install dependencies | |
working-directory: library/ | |
run: npm ci | |
- name: Publish npm package | |
run: npm publish --access public | |
working-directory: library/ | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
registry-url: 'https://npm.pkg.github.com' | |
scope: '@iotinga' | |
- name: Publish npm package (on private registry) | |
run: npm publish | |
working-directory: library/ | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-docs: | |
name: Build documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
working-directory: library/ | |
run: npm ci | |
- name: Build documentation | |
working-directory: library/ | |
run: npm run docs | |
- name: Configure GitHub Pages | |
uses: actions/configure-pages@v3 | |
- name: Fix permissions | |
run: | | |
chmod -c -R +rX "docs/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: docs/ | |
docs: | |
needs: build-docs | |
name: Publish documentation on GitHub pages | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |