Skip to content

Commit eae035e

Browse files
fix: use direct git push instead of peaceiris action to avoid file truncation
The peaceiris/actions-gh-pages action was truncating all JS files to 1,398 bytes. Switched to a simple git init + git push approach which should preserve file integrity.
1 parent 247d380 commit eae035e

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,24 @@ jobs:
160160
echo "Last 100 chars:"
161161
tail -c 100 dist/assets/vendor-three-C2c03BIj.js
162162
163-
# ✅ Deploy using gh-pages branch with LFS support for large files
163+
# ✅ Deploy using direct git push (avoids action truncation issues)
164164
- name: ⚡ Deploy to GitHub Pages
165-
uses: peaceiris/actions-gh-pages@v3
166-
with:
167-
github_token: ${{ secrets.GITHUB_TOKEN }}
168-
publish_dir: ./dist
169-
publish_branch: gh-pages
170-
force_orphan: true
171-
enable_jekyll: false
172-
allow_empty_commit: false
173-
keep_files: false
174-
full_commit_message: 'Deploy: ${{ github.event.head_commit.message }}'
175-
user_name: 'github-actions[bot]'
176-
user_email: 'github-actions[bot]@users.noreply.github.com'
177-
# Disable git lfs to avoid issues with large files
178-
lfs: false
165+
run: |
166+
echo "🚀 Deploying to gh-pages branch..."
167+
cd dist
168+
git init
169+
git config user.name "github-actions[bot]"
170+
git config user.email "github-actions[bot]@users.noreply.github.com"
171+
git add -A
172+
echo "📦 Files to commit:"
173+
git status --short
174+
echo "📏 Verifying file sizes before commit:"
175+
ls -lh assets/vendor-three-C2c03BIj.js
176+
wc -c assets/vendor-three-C2c03BIj.js
177+
git commit -m "Deploy: ${{ github.event.head_commit.message }}"
178+
echo "📤 Pushing to gh-pages..."
179+
git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:gh-pages
180+
echo "✅ Deployment complete!"
179181
180182
- name: ⚡ Verify deployment
181183
run: |

0 commit comments

Comments
 (0)