Repository: peaceiris/actions-gh-pages

Issue #29: INPUT_EMPTYCOMMITS is not defined with a docker image from Docker Hub
Created: 2019-09-21T17:31:40Z
I will fix this by #28
And I found it that inputs were not defined when we use a docker image from Docker Hub without with statement even though we defined emptyCommits default true
I will ask about this behavior at the GitHub Community forum.
INPUT_EMPTYCOMMITS were not defined

https://github.com/peaceiris/hugo-test-project/commit/f21f4cc80f318b040f622edf992f75a5d3d1caf2/checks#step:6:6

    - name: Deploy
      uses: docker://peaceiris/gh-pages:v2.3.1
      env:
        PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./public
-e PERSONAL_TOKEN -e PUBLISH_BRANCH -e PUBLISH_DIR -e HOME

INPUT_EMPTYCOMMITS were defined

emptyCommits: true https://github.com/peaceiris/hugo-test-project/commit/50360fbe2272dcb492395f91172c4757f8236d22/checks#step:6:8
emptyCommits: false https://github.com/peaceiris/hugo-test-project/commit/ef39a04b138b56a0bfe0715674789ac17e90eefd/checks#step:6:8

    - name: Deploy
      uses: docker://peaceiris/gh-pages:v2.3.1
      env:
        PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./public
      with:
        emptyCommits: true
        # emptyCommits: false
-e PERSONAL_TOKEN -e PUBLISH_BRANCH -e PUBLISH_DIR -e INPUT_EMPTYCOMMITS -e HOME

Originally posted by @peaceiris in #27 (comment)

Duplicate issue #31: Action passed with silent failure when no gh-pages branch existed
Created: 2019-09-22T04:50:07Z
Thanks for publishing this action.
I followed the readme instructions but ran into what may be a common but undocumented case.
I'm publishing for the first time and no gh-pages branch exists.
The action proceeds to stage changes but they never get pushed to my PUBLISH_BRANCH
Cloning into '/github/home/b8c542550a778e3eb0ca70abff3d5482'...
warning: Could not find remote branch gh-pages to clone.
fatal: Remote branch gh-pages not found in upstream origin
Initialized empty Git repository in /github/workspace/target/doc/.git/
Switched to a new branch 'gh-pages'
fatal: No such remote: 'origin'
INFO: Allowing empty commits: 
[gh-pages (root-commit) 975a973] Automated deployment: Sun Sep 22 04:26:54 UTC 2019 3a9dc85d243d35fe33b4992ae2a042c6793e8861
 131 files changed, 15230 insertions(+)
 create mode 100755 .lock
...more files...

My workflow step is configured with
- name: Publish
        uses: docker://peaceiris/gh-pages:v2.3.1
        env:
          PUBLISH_BRANCH: gh-pages
          PUBLISH_DIR: ./target/doc
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Closing comment (2019-09-22T04:54:45Z): Thank you. This issue is related to #29. I will fix this at #28
And, please do not use GITHUB_TOKEN #9
Try with ACTIONS_DEPLOY_KEY or PERSONAL_TOKEN

actions-gh-pages/README.md at 74f032c7e9f7be7e56320d6df9ca8707e104da12 · peaceiris/actions-gh-pages
NOTES: This action supports GITHUB_TOKEN but it has some problems to deploy to GitHub Pages. See #9

Please try the following.

Use ACTIONS_DEPLOY_KEY or PERSONAL_TOKEN
Set emptyCommits: true

      - name: Publish
        uses: docker://peaceiris/gh-pages:v2.3.1
        env:
+          ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
          PUBLISH_BRANCH: gh-pages
          PUBLISH_DIR: ./target/doc
+      with:
+        emptyCommits: true