Closed ndem0 closed 4 years ago
Please enable this option for deploying to protected branches.
In my side, I could deploy to protected branches with github_token.
Log: https://github.com/peaceiris/hugo-theme-iris/actions/runs/125917906/workflow
Also, there are no problems to deploy to protected branches with a deploy_key
.
Log: https://github.com/peaceiris/hugo-theme-iris/actions/runs/125905893/workflow
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./exampleSite/public
I'm pretty sure your actions is working on your side. But it is not working on my package, and the README and the log are not enough for debugging my problem.
I tried moving to the GITHUB_TOKEN, and enable the permission for force pushing. Still obtain an error in the final push. The complete log in the following lines.
Moreover, do you have figured out WHY the deploy_key is not read from the action? I shared with you the log in the first message, but you did not address my question.
Moreover, do you have figured out WHY the deploy_key is not read from the action? I shared with you the log in the first message, but you did not address my question.
I mentioned in this image about this in the following image. You have two cases:
I tried moving to the GITHUB_TOKEN, and enable the permission for force pushing. Still obtain an error in the final push. The complete log in the following lines.
And, I found that your stale gh-pages branch which was deployed two years ago.
I do not know the spec of stale branches. Maybe we have no permission to push to those branches with an auto-generated GITHUB_TOKEN.
If you can, how about deleting the gh-page branch and deploying it again?
GitHub Actions runner returns this error, not actions-gh-pages.
[warning]Unexpected input 'deploy_token', valid inputs are ['deploy_key', 'github_token', 'personal_token', 'publish_branch', 'publish_dir', 'external_repository', 'allow_empty_commit', 'keep_files', 'force_orphan', 'user_name', 'user_email', 'commit_message', 'full_commit_message', 'tag_name', 'tag_message', 'enable_jekyll', 'disable_nojekyll', 'cname']
https://github.com/mathLab/EZyRB/runs/742295203?check_suite_focus=true#step:6:1
In addition, I found that you are using invalid input name.
- deploy_token: ${{ secrets.DEPLOY_PRIVATE_KEY }}
+ deploy_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
Please read the README carefully.
That was a random test, with the hope that the variable name has been changed in some version but the README was not updated. It failed. I put again the deploy_key
variable and I got again the error as before. Please consider also to check the log I shared in this issues, since in the repository I'm still doing tests (very randomly now) and the log may refers just to some technical error, as in this case. The long log I attacched is the raw log of your action, no one error jumps out in the configuration, but only the permission trouble at the end.
To address to other points you raised (You forgot to add your private key as a secret variable to the secrets tab/You are using the wrong variable name instead of the variable name you added): I'm not able to see any errors, the names are the same.
I also tried to push manually on the branch (now is not a stale branch anymore), but the action still have issues.
In addition, I found that you are using invalid input name.
- deploy_token: ${{ secrets.DEPLOY_PRIVATE_KEY }} + deploy_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
Please read the README carefully.
And again, I read the README at least a couple of time, as well as many issues that are already closed.
And again, I read the README at least a couple of time, as well as many issues that are already closed.
OK. Thank you.
I forked your repo and tried to deploy your site and succeed in my case.
https://github.com/peaceiris/EZyRB/actions/runs/126011347/workflow
Could you try to deploy another branch like gh-pages-test
? For checking whether our permission problem is related to a stale branch or not.
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
publish_branch: gh-pages-test
publish_dir: ./docs/build/html
Deployment with deploy_key
on my fork has passed.
PR: https://github.com/peaceiris/EZyRB/pull/1
gh-pages
branchssh-keygen -t rsa -b 4096 -C "$(git config user.email)" -f gh-pages -N ""
# You will get 2 files:
# gh-pages.pub (public key)
# gh-pages (private key)
name: "Pull Request Docs Check"
on:
pull_request:
branches:
- master
jobs:
docs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Create the new documentation
uses: ammaraskar/sphinx-action@master
with:
pre-build-command: "python -m pip install pip sphinx_rtd_theme numpy scipy GPy matplotlib -U"
docs-folder: "docs/"
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
#github_token: ${{ secrets.GITHUB_TOKEN }}
deploy_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
publish_dir: ./docs/build/html
allow_empty_commit: true
Restart with new secret, new key and new action (I copied yours) and still fail.
And still unable to understand the error. Can you provide a way to individuate the problem, instead of replicating things until they work?
The actions runner on your repo seems to have something problem with parsing inputs. (missing the deploy_key
input)
https://github.com/mathLab/EZyRB/runs/742562857?check_suite_focus=true#step:5:1
Run peaceiris/actions-gh-pages@v3
with:
publish_dir: ./docs/build/html
allow_empty_commit: true
publish_branch: gh-pages
keep_files: false
force_orphan: false
enable_jekyll: false
disable_nojekyll: false
This log was dumped by github actions runner.
Maybe we need to report this problem at actions/runner or GitHub support... (I will do it)
That's my point from the beginning: the variable deploy_key
is not read.
I'm not an expert about Github Actions, so I really don't know what's the problem and how to solve it.
Another test I did is changing the version of the action (v3 -> v2) changes the error (with v2, the variable deploy_key
is read, but I received one warning because is not a valid option), but the deploy fails.
Very very sorry...
Now, I found that you are trying it on a pull-request from a forked repo. The demo
branch is on your forked repo, not on the mathLab organization.
As GitHub Actions spec, for the pull_request
event. All secrets are not passed to fork repo's event for our security.
Please run your job on a push
event or pull_request
event which is created by repository collaborators.
For more details:
About permissions for the GITHUB_TOKEN: Authenticating with the GITHUB_TOKEN - GitHub Help
About secrets: Creating and storing encrypted secrets - GitHub Help
With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository.
OK. I will enhance our warning message when this action runs on a forked repo. All users do not know the spec of GitHub Actions' secrets.
I'm very sorry for taking a long time for this. As a long-service user, I should have noticed your event triggered by a forked repo at first...
No problem at all! The important is having found the problem. I managed to trigger the action when a new tag is pushed, and everything works!
Sorry for the little mess, I was not aware of such limitations related to PR.
No problem at all! The important is having found the problem. I managed to trigger the action when a new tag is pushed, and everything works!
I'm happy to hear that!
Sorry for the little mess, I was not aware of such limitations related to PR.
No problem. We can make the log more friendly. After I will improve the warning message for execution on a forked repository, this issue will be closed.
Thank you for using this action and for asking me about this!
No problem. We can make the log more friendly. After I will improve the warning message for execution on a forked repository, this issue will be closed.
I will work on this at #359. Thank you.
Note that an issue which does not follow the template will be closed silently.
Check list before opening this issue
Describe your question
Trying to push the
docs/build/html
directory to thegh-pages
branch. Since the branch is protected, I guess thegithub_token
is not enough (I got some permission error while pushing) then I'm trying to use thedeploy_key
. I already added the private key on repository secrets and the public one to the deploy keys. Unluckily, the action seems not reading thedeploy_key
variable, gettingAction failed with "not found deploy key or tokens"
.The action log before error is:
Link to your contents
Additional context
Already check the Github status, since I've seen many problem related (#319) with the Github servers, but during my tests the status was always fine.