feat(calculator): live expression on top line, paste into expression line #274
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: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| check-changelog: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Check for CHANGELOG file in commit | |
| run: | | |
| # Get files changed in this push/PR. | |
| # Use --diff-filter=ACMR so deletions don't count — removing a file | |
| # shouldn't fail a rule that's checking for file presence. | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| FILES=$(git diff --name-only --diff-filter=ACMR HEAD~1 HEAD 2>/dev/null || git diff --name-only --diff-filter=ACMR ${{ github.event.pull_request.base.sha }} HEAD) | |
| else | |
| FILES=$(git diff --name-only --diff-filter=ACMR HEAD~1 HEAD) | |
| fi | |
| echo "Changed files (added/modified/copied/renamed):" | |
| echo "$FILES" | |
| # Check if any code files changed (ignore docs-only) | |
| CODE_FILES=$(echo "$FILES" | grep -vE '\.(md|txt|json)$' | grep -vE '^\.(agent|github)/' || true) | |
| if [ -z "$CODE_FILES" ]; then | |
| echo "✅ Docs-only commit — changelog not required." | |
| exit 0 | |
| fi | |
| # Reject changelogs placed in repo root instead of changelogs/. | |
| # Only checks added/modified files (see --diff-filter above); pure deletions are allowed. | |
| ROOT_CHANGELOG=$(echo "$FILES" | grep -E '^CHANGELOG-.*\.md$' || true) | |
| if [ -n "$ROOT_CHANGELOG" ]; then | |
| echo "" | |
| echo "❌ FAILED: Changelog found in repo root — must be in changelogs/ directory." | |
| echo " Found: $ROOT_CHANGELOG" | |
| echo " Move it: git mv $ROOT_CHANGELOG changelogs/" | |
| echo "" | |
| exit 1 | |
| fi | |
| # Check for CHANGELOG file in changelogs/ directory | |
| CHANGELOG=$(echo "$FILES" | grep -E '^changelogs/CHANGELOG-.*\.md$' || true) | |
| if [ -z "$CHANGELOG" ]; then | |
| echo "" | |
| echo "❌ FAILED: No changelog found in changelogs/ directory." | |
| echo "" | |
| echo "Every commit with code changes must include a changelogs/CHANGELOG-<topic>.md file." | |
| echo "Example: changelogs/CHANGELOG-my-feature.md" | |
| echo "" | |
| exit 1 | |
| fi | |
| echo "✅ Found changelog: $CHANGELOG" | |
| build: | |
| needs: check-changelog | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |