From 3b3a0248f05897ba5ff97bf4a79a5117722391f8 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Mon, 2 Feb 2026 08:27:29 +0530 Subject: [PATCH] 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. --- .github/workflows/deploy-gh-pages.yml | 76 +++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/deploy-gh-pages.yml diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml new file mode 100644 index 000000000..e31d7ede0 --- /dev/null +++ b/.github/workflows/deploy-gh-pages.yml @@ -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]"