add workflow to build pr previews #4
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-next-package | |
on: | |
push: | |
branches: [main] | |
jobs: | |
release-next-package: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Lint | |
run: npm run lint | |
- name: Test | |
run: npm test | |
- name: Publish to npm | |
run: | | |
next_version=$(npm view @redhat-developer/red-hat-developer-hub-theme@next version) | |
npm version $next_version --no-git-tag-version | |
npm version patch --no-git-tag-version | |
npm publish --access=public --tag=next | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |