feat: migrate to version 1.0.0 with TypeScript support and improved m… #2
This file contains hidden or 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
| # Copyright 2024 Ronan LE MEILLAT | |
| # Licensed under the Affero GPL v3 | |
| name: Build and Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| packages: write | |
| attestations: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build the project | |
| run: npm run build | |
| - name: Run tests | |
| run: npm test | |
| - name: Deploy to GitHub Pages | |
| continue-on-error: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add dist | |
| git commit -m 'Update dist' dist/* | |
| git push origin main | |
| - name: Publish to npm | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.NPMJS_TOKEN}} | |
| run: npm publish | |
| continue-on-error: true |