mirror of
https://github.com/elder-plinius/P4RS3LT0NGV3.git
synced 2026-06-06 15:03:57 +02:00
refactor: migrate to modular tool-based architecture
- Implement tool registry system with individual tool modules - Reorganize transformers into categorized source modules - Remove emojiLibrary.js, consolidate into EmojiUtils and emojiData - Fix mobile close button and tooltip functionality - Add build system for transforms and emoji data - Migrate from Python backend to pure JavaScript - Add comprehensive documentation and testing - Improve code organization and maintainability - Ignore generated files (transforms-bundle.js, emojiData.js)
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
# GitHub Actions Workflows
|
||||
|
||||
## `deploy.yml` - Automated GitHub Pages Deployment
|
||||
|
||||
This workflow automatically builds and deploys the project to GitHub Pages whenever changes are pushed to the `main` or `master` branch.
|
||||
|
||||
### What it does:
|
||||
|
||||
1. **Build Stage:**
|
||||
- Checks out the repository
|
||||
- Sets up Node.js (v18)
|
||||
- Installs dependencies with `npm ci`
|
||||
- Runs `npm run build` which:
|
||||
- Builds transformer index (`build-index.js`)
|
||||
- Bundles all transformers (`build-transforms.js`)
|
||||
- Generates emoji 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
|
||||
|
||||
2. **Deploy Stage:**
|
||||
- Deploys the artifact to GitHub Pages
|
||||
- Makes the site available at your GitHub Pages URL
|
||||
|
||||
### Manual Deployment
|
||||
|
||||
You can also trigger a deployment manually from the GitHub Actions tab by selecting "Build and Deploy to GitHub Pages" and clicking "Run workflow".
|
||||
|
||||
### Required GitHub Settings
|
||||
|
||||
For this workflow to function, ensure GitHub Pages is configured in your repository settings:
|
||||
|
||||
1. Go to **Settings** → **Pages**
|
||||
2. Under **Build and deployment**:
|
||||
- Source: **GitHub Actions**
|
||||
3. Save the settings
|
||||
|
||||
The site will be available at: `https://<username>.github.io/<repository-name>/`
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
- **Build fails**: Check the Actions tab for error logs
|
||||
- **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
|
||||
|
||||
### Workflow Triggers
|
||||
|
||||
- **Push**: Automatically runs on push to `main` or `master`
|
||||
- **Workflow Dispatch**: Can be manually triggered from the Actions tab
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Build and Deploy to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
# Allow manual trigger from Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions for GitHub Pages deployment
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build project
|
||||
run: |
|
||||
echo "Running full build..."
|
||||
npm run build
|
||||
echo "Build complete!"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: '.'
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
Reference in New Issue
Block a user