docs: update ci with storybook axe testing #140
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
# See https://github.com/google-github-actions/release-please-action | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Build and test | |
run: | | |
npm ci | |
npm run format:check | |
npm run test | |
npm run test:axe | |
npm run build:package | |
npm run build:dist | |
- name: Create zip artifact | |
if: github.ref == 'refs/heads/main' | |
run: | | |
mkdir -p artifact | |
zip -r artifact/ogcio-ds.zip dist/@ogcio/* | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
release-type: node | |
if: github.ref == 'refs/heads/main' | |
- name: Upload Release Artifact | |
if: ${{ steps.release.outputs.release_created }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload ${{ steps.release.outputs.tag_name }} ./artifact/ogcio-ds.zip | |
- name: Publish to npm | |
if: ${{ steps.release.outputs.release_created }} | |
run: npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |