mhausenblas / mkdocs-deploy-gh-pages

GitHub Action to deploy an MkDocs site to GitHub Pages
Apache License 2.0
250 stars 90 forks source link

How to deploy the pages to another remote? #128

Open taicaile opened 3 years ago

taicaile commented 3 years ago

Hello,

Is there a way to add remote configuration for mkdocs gh-deploy command in Github Action environment?

I am holding the docs in a private repo, and I want the docs to be pushed to another remote repo that is publicly available.

The command mkdocs gh-deploy can specify the remote by --remote option, I don't know how to use it in a Github Action environment.

Any suggestions? I have tried to add remote as the following URL:

https://$USER_NAME:$API_TOKEN_GITHUB@github.com/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git

But this gives the following error

remote: Permission to xxx/blog.git denied to github-actions[bot].
WillNilges commented 1 year ago

Don't suppose you ever figured this out, did you? I'm getting a similar issue, but I'm just trying to make it deploy when I commit anything at all to the markdown...

andi34 commented 2 months ago

https://github.com/andi34/mkdocs-deploy-gh-pages/tree/nomaterial

Added to my fork.

Needs

      - name: Checkout main
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.PAT_TOKEN }} # Uses Personal Access Token (PAT) for checkout, needed to push Changes to Another Repository

Also define GITHUB_ORIGIN andPERSONAL_TOKEN`.

Example: https://github.com/PhotoboothProject/photobooth/blob/dev/.github/workflows/publish_docs.yml