Cloudflare Pages Monorepo with Github Actions

So Cloudflare Pages doesn’t support MonoRepo Yet.

My solution is to create a Github Action on push event which:

  1. Check out the origin repo with pushing branch
  2. Init an another repo on the sub project folder
  3. Commit and push to the mirror repo.

Please let me know if your solutions!

That’s generally the best solution for now! I know monorepo support is on the team’s todo list, so if you haven’t already I’d recommend joining the Workers Discord to stay up to date on a lot of upcoming Pages things.

1 Like

(post deleted by author)

For anyone who gonna need the workflow. This action auto push new commit form the monorepo to the mirror repo.

name: inix push

on:
  push:
    branches:
      - "*"
      - "!main"
    paths:
      - .github/workflows/inix_push.yml
      - inix/**

jobs:
  push:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
        with:
          ref: ${{ github.ref }}
          persist-credentials: false
          fetch-depth: 0
      - run: |
          rm -rf .git
          cd inix
          git init
          git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
          git config --local user.name "github-actions[bot]"
          git add .
          git commit -m "Mirror change" -a
      - uses: ad-m/[email protected]
        with:
          github_token: ${{ secrets.MIRROR_PAT }}
          repository: chientrm/inix
          branch: ${{ github.ref }}
          directory: inix
          force: true
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.