mirror of
https://github.com/elder-plinius/P4RS3LT0NGV3.git
synced 2026-07-12 15:36:32 +02:00
updated build process
This commit is contained in:
@@ -8,18 +8,21 @@ This workflow automatically builds and deploys the project to GitHub Pages whene
|
||||
|
||||
1. **Build Stage:**
|
||||
- Checks out the repository
|
||||
- Sets up Node.js (v18)
|
||||
- Sets up Node.js (v20) with npm cache enabled
|
||||
- Installs dependencies with `npm ci`
|
||||
- Runs test suite with `npm run test:all`
|
||||
- Runs `npm run build` which:
|
||||
- Copies static files to `dist/` (`copy-static.js`)
|
||||
- Builds transformer index (`build-index.js`)
|
||||
- Bundles all transformers (`build-transforms.js`)
|
||||
- Generates emoji data (`build-emoji-data.js`)
|
||||
- Bundles all transformers to `dist/js/bundles/` (`build-transforms.js`)
|
||||
- Generates emoji data to `dist/js/data/` (`build-emoji-data.js`)
|
||||
- Injects tool scripts (`inject-tool-scripts.js`)
|
||||
- Injects tool templates into `index.html` (`inject-tool-templates.js`)
|
||||
- Uploads the entire project as a Pages artifact
|
||||
- Injects tool templates into `dist/index.html` (`inject-tool-templates.js`)
|
||||
- Verifies critical build files exist in `dist/`
|
||||
- Uploads only the `dist/` folder as a Pages artifact (7-day retention)
|
||||
|
||||
2. **Deploy Stage:**
|
||||
- Deploys the artifact to GitHub Pages
|
||||
- Deploys the `dist/` artifact to GitHub Pages
|
||||
- Makes the site available at your GitHub Pages URL
|
||||
|
||||
### Manual Deployment
|
||||
@@ -40,9 +43,11 @@ The site will be available at: `https://<username>.github.io/<repository-name>/`
|
||||
### Troubleshooting
|
||||
|
||||
- **Build fails**: Check the Actions tab for error logs
|
||||
- **Tests fail**: Run `npm run test:all` locally to debug issues
|
||||
- **Missing templates**: Ensure all templates exist in `templates/` directory
|
||||
- **Test locally first**: Run `npm run build:templates` before pushing to catch errors early
|
||||
- **Verify build output**: Check that `index.html` contains injected templates after build
|
||||
- **Test locally first**: Run `npm run build` before pushing to catch errors early
|
||||
- **Verify build output**: Check that `dist/index.html` and other files exist in `dist/` folder after build
|
||||
- **Build timeout**: Build has a 10-minute timeout; if it exceeds this, check for infinite loops or large file processing
|
||||
|
||||
### Workflow Triggers
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ concurrency:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -28,21 +29,33 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run tests
|
||||
run: npm run test:all
|
||||
|
||||
- name: Build project
|
||||
run: |
|
||||
echo "Running full build..."
|
||||
npm run build
|
||||
echo "Build complete!"
|
||||
|
||||
- name: Verify build output
|
||||
run: |
|
||||
test -f dist/index.html || (echo "❌ dist/index.html missing!" && exit 1)
|
||||
test -f dist/js/bundles/transforms-bundle.js || (echo "❌ dist/js/bundles/transforms-bundle.js missing!" && exit 1)
|
||||
test -f dist/js/data/emojiData.js || (echo "❌ dist/js/data/emojiData.js missing!" && exit 1)
|
||||
echo "✅ All critical build files present"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: '.'
|
||||
path: 'dist/'
|
||||
retention-days: 7
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user