Skip to content

Conversation

j-mes
Copy link
Owner

@j-mes j-mes commented Sep 11, 2025

This pull request refactors and consolidates the GitHub Actions workflows for building and deploying the project. The separate build and deployment workflow (build-and-deploy.yml) has been removed, and its logic has been merged into the main build workflow (build.yml). The new workflow also introduces improved deployment practices and updates several actions to their latest versions.

Workflow consolidation and deployment improvements:

  • Removed the .github/workflows/build-and-deploy.yml file, consolidating build and deployment steps into a single workflow.
  • Updated .github/workflows/build.yml to handle both pull requests and pushes to main, including deployment to GitHub Pages only on pushes to main.
  • Added least-privilege permissions and concurrency controls to prevent overlapping deployments and improve security.
  • Switched to newer versions of GitHub Actions (actions/checkout@v4, actions/setup-node@v4) and replaced the deployment step with actions/deploy-pages@v4, aligning with recommended practices for GitHub Pages.
  • Improved artifact upload and deployment logic by using actions/upload-pages-artifact@v2 and conditionally deploying only when appropriate.

@j-mes j-mes requested a review from Copilot September 11, 2025 14:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request consolidates the GitHub Actions workflows by merging the separate build and deployment workflow into a single workflow file that handles both building and deploying the project. The changes introduce improved security practices, update actions to newer versions, and implement deployment to GitHub Pages using the recommended approach.

  • Removed the separate build-and-deploy.yml workflow file
  • Enhanced the main build.yml workflow to handle both pull requests and pushes to main branch
  • Updated to newer action versions and implemented least-privilege permissions with concurrency controls

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/build.yml Consolidated workflow that now handles both building and deploying, with updated actions and improved security
.github/workflows/build-and-deploy.yml Removed separate deployment workflow file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +51 to +53
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
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.

Comment on lines +47 to +48
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
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.

@j-mes j-mes merged commit dae1330 into main Sep 11, 2025
1 check failed
@j-mes j-mes deleted the chore/consolidate-workflow branch September 11, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant