chore: add GitHub Actions workflow for deploying to GitHub Pages

- Introduced a new workflow to automate deployment to GitHub Pages upon successful completion of the version bump workflow.
- Configured steps for checking out code, setting up Node.js, installing dependencies, building the frontend, and deploying to both the gh-pages and main branches.

This addition enhances the deployment process and ensures that the latest changes are reflected on GitHub Pages automatically.
This commit is contained in:
Steven Enamakel
2026-02-02 08:27:29 +05:30
parent f8a9fa92b8
commit 3b3a0248f0
+76
View File
@@ -0,0 +1,76 @@
name: Deploy to GitHub Pages
on:
workflow_run:
workflows: ["Version Bump"]
types:
- completed
branches:
- main
permissions:
contents: write
concurrency:
group: deploy-gh-pages
cancel-in-progress: false
jobs:
deploy:
environment: Production
runs-on: ubuntu-latest
# Only run if the version-bump workflow succeeded
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.XGH_TOKEN }}
repository: alphahumanxyz/alphahuman
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build frontend
run: yarn build
env:
NODE_ENV: production
VITE_BACKEND_URL: ${{ vars.VITE_BACKEND_URL }}
VITE_TELEGRAM_BOT_USERNAME: ${{ secrets.VITE_TELEGRAM_BOT_USERNAME }}
VITE_TELEGRAM_BOT_ID: ${{ secrets.VITE_TELEGRAM_BOT_ID }}
VITE_TELEGRAM_API_ID: ${{ secrets.VITE_TELEGRAM_API_ID }}
VITE_TELEGRAM_API_HASH: ${{ secrets.VITE_TELEGRAM_API_HASH }}
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
VITE_SKILLS_GITHUB_REPO: ${{ vars.VITE_SKILLS_GITHUB_REPO }}
VITE_SKILLS_GITHUB_TOKEN: ${{ secrets.VITE_SKILLS_GITHUB_TOKEN }}
VITE_DEBUG: ${{ vars.VITE_DEBUG }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.XGH_TOKEN }}
external_repository: alphahumanxyz/alphahuman
publish_dir: ./deploy
publish_branch: gh-pages
commit_message: "chore: deploy to gh-pages [skip ci]"
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
- name: Update GH repo
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.XGH_TOKEN }}
external_repository: alphahumanxyz/alphahuman
publish_dir: ./publish
publish_branch: main
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
commit_message: "chore: update main branch [skip ci]"