Merge branch 'main' of https://github.com/bocan/ultraformat #25
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
| # CI runs on every push and PR. | |
| # Merges to main: bump version + release, then build with new version + deploy. | |
| name: CI & Deploy | |
| on: | |
| push: | |
| branches: [ "**" ] | |
| paths-ignore: | |
| - 'CHANGELOG.md' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js 24.x | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm run lint | |
| - run: npm test | |
| - run: npm run build | |
| release: | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: ci | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: "release" | |
| cancel-in-progress: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node.js 24.x | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| cache: 'npm' | |
| - run: npm ci | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Run release | |
| run: npm run release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push changes | |
| run: git push --follow-tags origin main | |
| - name: Extract version | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tag }} | |
| name: Release ${{ steps.version.outputs.tag }} | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false | |
| deploy: | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: release | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: "pages-deploy" | |
| cancel-in-progress: false | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: main # pull the latest main (with bumped version) | |
| - name: Use Node.js 24.x | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm run build | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist/ | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |