jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
528 stars 47 forks source link

How to deploy to other code repository #129

Closed mcxinyu closed 1 year ago

mcxinyu commented 1 year ago

How to deploy to other code repository

My document repository and deployment repository are not the same repository. Can I deploy documents to different repository?

jimporter commented 1 year ago

I think this would work:

cd /path/to/your/deployment/repo
mike deploy --config-file /path/to/your/document/repo/mkdocs.yml
mcxinyu commented 1 year ago

Oh, I deployed by GitHub action CI, which is not operated locally.

I'm not sure if I can clone external projects in CI.

jimporter commented 1 year ago

You can:

      # Clone the current repo
      - uses: actions/checkout@v3
      # Clone some other repo
      - uses: actions/checkout@v3
        with:
          repository: user/repository
          path: somewhere
mcxinyu commented 1 year ago

This is how I solved it, and I hope it will help others.

      # Ignore other content

      - name: Sync Git Branch Action
        uses: zent-contrib/sync-git-branch@v1.0.0
        env:
          SSH_PRIVATE_KEY: ${{ secrets.ID_ED25519 }}
        with:
          source-branch: gh-pages
          destination-repo: "git@github.com:xxx/xxx.git"