Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/build-and-deploy.yml

This file was deleted.

47 changes: 36 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
name: Build on PR
name: Build & Deploy

on:
push:
branches: ['main']
pull_request:
branches: ['main']

# Least-privilege permissions for Pages
permissions:
contents: read
pages: write
id-token: write

# Avoid overlapping deployments
concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['24.2.0']

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: '24.2.0'
cache: 'npm'

- name: Install packages
- name: Install dependencies
run: npm ci

- name: Run npm build
- name: Build
run: npm run build

# Only deploy on push to main
- name: Upload Pages artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v2
with:
path: ./dist

- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Comment on lines +47 to +48
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deploy step should include a needs dependency on the upload step to ensure proper sequencing. Consider restructuring this as a separate job that depends on the build job to follow GitHub Pages deployment best practices.

Suggested change
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# Removed from build job; will be added as a separate deploy job below.
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages

Copilot uses AI. Check for mistakes.

id: deployment
uses: actions/deploy-pages@v4
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
Comment on lines +51 to +53
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented environment configuration. If this configuration is needed, it should be uncommented and properly configured. Otherwise, it adds unnecessary clutter to the workflow file.

Suggested change
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}

Copilot uses AI. Check for mistakes.

Loading