Skip to content

Commit

Permalink
chore: ci fix (#2298)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Gomez <[email protected]>
  • Loading branch information
grothem and alexmance authored Jan 3, 2025
1 parent c857e82 commit 25803d9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
29 changes: 27 additions & 2 deletions .github/actions/analyze-comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ runs:
steps:
- name: Download PR bundle stats
if: github.event.workflow_run.id
continue-on-error: true
uses: dawidd6/action-download-artifact@ea71f332a90fd52416b1629b933dcf7e0ccd421d # v2.22.0
with:
workflow: build-fork.yml
Expand All @@ -32,16 +33,40 @@ runs:
- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@ea71f332a90fd52416b1629b933dcf7e0ccd421d # v2.22.0
if: github.event_name != 'push'
continue-on-error: true
with:
workflow: build-test-deploy.yml
branch: main
name: bundle
path: .next/analyze/base/bundle/

- name: Compare with base branch bundle
- name: Handle missing bundle
if: github.event_name != 'push'
shell: bash
run: |
if [ ! -d ".next/analyze/base/bundle" ]; then
echo "No base bundle found, creating baseline"
mkdir -p .next/analyze/base/bundle
if [ -f ".next/analyze/__bundle_analysis.json" ]; then
cp .next/analyze/__bundle_analysis.json .next/analyze/base/bundle/
echo "Baseline bundle created successfully"
else
echo "Warning: Source bundle analysis file not found"
echo "{}" > .next/analyze/base/bundle/__bundle_analysis.json
echo "Created empty baseline bundle"
fi
fi
- name: Compare with base branch bundle
if: github.event_name != 'push' && !contains(github.ref, 'main')
shell: sh
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
run: |
if [ -d ".next/analyze/base/bundle" ]; then
ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
else
echo "No base bundle found for comparison. Skipping comparison step."
cp .next/analyze/__bundle_analysis.json .next/analyze/__bundle_analysis_comment.txt
fi
- name: Get comment body
id: get-comment-body
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/upload-artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ runs:
name: pr
path: __pr/
retention-days: 10

- name: store static build
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with:
name: '${{ inputs.BUILD_ARTIFACT_NAME }}'
path: out/
retention-days: 10

- name: store nextjs build
if: inputs.NEXTJS_BUILD == 'true'
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
Expand All @@ -46,4 +44,3 @@ runs:
.next
!.next/cache
retention-days: 10

4 changes: 2 additions & 2 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2

- name: download build
uses: actions/download-artifact@v4.1.8 # v3.0.0
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0
with:
name: nextjs_build
path: .next
Expand All @@ -137,7 +137,7 @@ jobs:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2

- name: download build
uses: actions/download-artifact@v4.1.8 # v3.0.0
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0
with:
name: out
path: out
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-prod-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2

- name: download build
uses: actions/download-artifact@v4.1.8 # v3.0.0
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0
with:
name: ${{ matrix.environment.artifact }}
path: ${{ matrix.environment.build_path }}
Expand Down

1 comment on commit 25803d9

@github-actions
Copy link

Choose a reason for hiding this comment

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

This commit was deployed on ipfs

Please sign in to comment.