Some Question about deploy in gh-page and Depoly failure with gh-pages: detected dubious ownership in repository and how to publish correctly

Goal (just proved XY question)

I was trying to use a themes names ataraxia-zola to generalize my blog.

  • today, I have trying to do everything in the manual(getzola.o rg/document !%!#%!% ation/deployment/github-pages/) and I could successful to deploy the example site into GitHub pages
  • then, I have trying to do two steps
    1. Try if I could make a kind of post private
    2. Try to using themes in the blog

Question and misunderstand in manual

  1. what we need to do to set up the workflow to let me could write and push in repo A (private), and then B.github.io(public) could deploy it correctly
  2. is we have to contain both .github/workf lows/main.yml and build.yml at the same time ?
  3. what is the different between GITHUB_TOKEN and TOKEN, and is the correct ways for we to generalize it ? *now i have using settings->development settings-> classical, which is BC manual say it needs a kind of public_repo permission.

Let’s start with the token. Remember, if you are publishing the site on the same repo, you do not need to follow that step. But you will still need to pass in the automatic GITHUB_TOKEN as explained [here](https://docs.github.com /en/actions/security-guides/a !@%!%#%! utomatic-token-authentication#example-1-passing-the-github_token-as-an-input).

  1. is the build repo have to had the ability to read private repo, and detect if the repo specify branch has been push, so the TOKEN for this, should be as same as the prev one is it ? maybe not using classify ways to gerneralized token
  2. it seems that GITHUB_TOKEN will not been support by settings, so why not just change another name, or it’s variable is being generated auto by GitHub?

For creating the token either click on here or go to Settings > Developer Settings > Personal access tokens. Under the Select Scopes section, give it public_repo permissions and click Generate token. Then copy the token, navigate to your repository and add in the Settings tab the Secret TOKEN and paste your token in it.
6. is the correct ways that i have put my TOKEN is correct? secret->actions->new repo secret

The error I have facing

failure output

/usr/bin/docker run --name c044293f8496780464446a88bcfa0d6111cc0_839817 --label 6c0442 --workdir /github/workspace --rm -e "PAGES_BRANCH" -e "TOKEN" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v
"/home/runner/work/blog/blog":"/github/workspace" 6c0442:93f8496780464446a88bcfa0d6111cc0
Starting deploy...
Fetching themes
fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace

the build.yml file current(i haven’t continure to using main.yml)

# On every push this script is executed
on: push
name: Build preview on Github-Pages
jobs:
  build:
    name: shalzz/zola-deploy-action
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    steps:
      - name: checkout
        uses: actions/checkout@v3.0.0
      - run: sudo git config --system --add safe.directory /github/workspace # base on others soluction
      - name: build_and_deploy
        uses: shalzz/zola-deploy-action@v0.16.1
        env:
          # Target branch
          PAGES_BRANCH: gh-pages
          # Provide personal access token
          TOKEN: ${{ secrets.TOKEN }}
          # Or if publishing to the same repo, use the automatic token
          #TOKEN: ${{ secrets.GITHUB_TOKEN }}