Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deploy to other repo (#35) #36

Merged
merged 10 commits into from
Oct 6, 2019
Merged

feat: deploy to other repo (#35) #36

merged 10 commits into from
Oct 6, 2019

Conversation

skyfrk
Copy link
Contributor

@skyfrk skyfrk commented Sep 27, 2019

⚠ I didn't test this yet!

This PR addresses #35 .

  • I added a new environment variable PUBLISH_REPO (format: <username>/<repo>) which is used to build the remote_repo strings.
  • If PUBLISH_REPO is not set it will be set and initialized with GITHUB_REPOSITORY.
  • If PUBLISH_REPO is different from GITHUB_REPOSITORY and GITHUB_TOKEN is used an error message will be printed and the script exits (the GITHUB_TOKEN is scoped to the repository which runs the action).

Example how this can be used:

- name: Deploy
  uses: peaceiris/[email protected]
  env:
    ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
    PUBLISH_REPO: peaceiris/peaceiris.github.io
    PUBLISH_BRANCH: master
    PUBLISH_DIR: ./public

Any feedback is welcome 😊

@peaceiris
Copy link
Owner

Thank you. I will add some changes.

peaceiris added a commit to peaceiris/hugo-test-project that referenced this pull request Sep 27, 2019
@peaceiris
Copy link
Owner

peaceiris commented Sep 27, 2019

@skyfrk You can test now.

I could deploy with PERSONAL_TOKEN

    - name: Deploy
      uses: peaceiris/actions-gh-pages@feature/deploy_to_other_repo
      env:
        # ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
        PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./public
        EXTERNAL_REPOSITORY: peaceiris/test-hugo-external-repo

1
2
3

@peaceiris
Copy link
Owner

peaceiris commented Sep 27, 2019

@peaceiris
Copy link
Owner

peaceiris commented Sep 27, 2019

We can test with v2.5.0-rc0 now.

Test with the docker image from Docker Hub succeeded.

@peaceiris
Copy link
Owner

LGTM.
@skyfrk Do we need any other changes?

@peaceiris
Copy link
Owner

peaceiris commented Sep 27, 2019

Oh, internal deployment failed. Why?

@peaceiris
Copy link
Owner

peaceiris commented Sep 27, 2019

Test on my private repo with docker://peaceiris/gh-pages:v2.5.0-rc0 succeeded. peaceiris/hugo-test-project has some problems. I cannot figure it out.

We need more tests with docker://peaceiris/gh-pages:v2.5.0-rc0 and peaceiris/[email protected] for existing workflows.

@peaceiris peaceiris added enhancement New feature or request stale labels Sep 27, 2019
@skyfrk
Copy link
Contributor Author

skyfrk commented Sep 27, 2019

My tests using

    - name: Deploy to GitHub Pages
      uses: peaceiris/actions-gh-pages@feature/deploy_to_other_repo
      env:
        ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
        PUBLISH_BRANCH: master
        PUBLISH_DIR: ./public
        EXTERNAL_REPOSITORY: skyfrk/skyfrk.github.io

and

    - name: Deploy to GitHub Pages
      uses: peaceiris/[email protected]
      env:
        ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
        PUBLISH_BRANCH: master
        PUBLISH_DIR: ./public
        EXTERNAL_REPOSITORY: skyfrk/skyfrk.github.io

were successfull! 😄

Could you eloborate on the problems you're facing?

@peaceiris
Copy link
Owner

peaceiris commented Sep 27, 2019

See this log https://github.com/peaceiris/hugo-test-project/commits/gh-pages

GitHub Pages build event did not start with v2.5.0-rc0 for internal deployment. External is OK.

log

@skyfrk
Copy link
Contributor Author

skyfrk commented Sep 28, 2019

Looks like a GitHub Action bug to me. Can you try to trigger an internal deployment again?

@peaceiris
Copy link
Owner

peaceiris commented Sep 28, 2019

The internal deployment failed again.

log

    - name: Deploy
      uses: peaceiris/[email protected]
      env:
        ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./public

@skyfrk
Copy link
Contributor Author

skyfrk commented Sep 28, 2019

I don't get it. The gh-pages branch is up to date but not deployed to GH Pages?

@peaceiris
Copy link
Owner

peaceiris commented Sep 29, 2019


(Oct 1)

  • gatsby-test looks good.
  • hugo-test-project still sometimes failed.

hugo

@philomath213
Copy link

philomath213 commented Oct 4, 2019

hey I test v2.5.0-rc0 with to deploy Hugo web site internally and it's working fine
check the test repository for more details,
https://github.com/philomath213/hugo-ci-test
Screenshot from 2019-10-04 19-18-26

@peaceiris
Copy link
Owner

Thank you so much @philomath213
Yes, your deployment looks good.

Screen Shot 2019-10-05 at 10 27 56

@peaceiris peaceiris self-requested a review October 6, 2019 10:35
@peaceiris
Copy link
Owner

After more testing, I will relase v2.5.0. Thank you.

@peaceiris peaceiris merged commit 37e4747 into peaceiris:master Oct 6, 2019
@peaceiris peaceiris mentioned this pull request Oct 6, 2019
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants