Add build pipeline for SVG to PNG rendering #1
Workflow file for this run
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - run: npx playwright install --with-deps chromium | |
| - run: npm run build | |
| - name: Preview release version | |
| if: github.event_name == 'pull_request' | |
| continue-on-error: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git checkout ${{ github.event.pull_request.head.sha }} | |
| OUTPUT=$(unset GITHUB_ACTIONS; npx semantic-release --dry-run --no-ci --branches ${{ github.head_ref }} 2>&1) || true | |
| echo "$OUTPUT" | |
| VERSION=$(echo "$OUTPUT" | grep -oP 'The next release version is \K[0-9]+\.[0-9]+\.[0-9]+' | head -1 || echo "") | |
| if [ -n "$VERSION" ]; then | |
| gh pr comment ${{ github.event.pull_request.number }} \ | |
| --body "This PR will release **v${VERSION}**" | |
| fi | |
| - name: Release | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npx semantic-release |