-
Notifications
You must be signed in to change notification settings - Fork 0
chore: consolidate actions workflow #388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
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' | ||||||||
id: deployment | ||||||||
uses: actions/deploy-pages@v4 | ||||||||
# environment: | ||||||||
# name: github-pages | ||||||||
# url: ${{ steps.deployment.outputs.page_url }} | ||||||||
Comment on lines
+51
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
There was a problem hiding this comment.
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.Copilot uses AI. Check for mistakes.