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

Add Github Action tip to README #368

Closed
wants to merge 2 commits into from
Closed

Add Github Action tip to README #368

wants to merge 2 commits into from

Conversation

mickelsonmichael
Copy link
Contributor

After having spent a few hours attempting to configure the gh-pages cli to perform on Github's Actions, including using a third-party plugin, a lot of time could have been saved by simply having this tip readily accessible.

The tip should lay out how to correctly configure a step to deploy an application via Github Actions. See issue #345 for more details
@ThHareau
Copy link

Thanks @mickelsonmichael it works well

Comment on lines +396 to +399
# REPLACE "tschaub/gh-pages" IN THE GIT URL BELOW WITH YOUR REPOSITORY'S INFORMATION
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/tschaub/gh-pages.git
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the instruction to replace the repository name in the git url is actually not necessary if you use the GITHUB_REPOSITORY environment variable 😉
https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables

git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git

- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/tschaub/gh-pages.git
npx gh-pages -d build -u "github-actions-bot <support+actions@github.com>"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I came across gh-pages via the example in the create-react-app docs: https://create-react-app.dev/docs/deployment/#step-2-install-gh-pages-and-add-deploy-to-scripts-in-packagejson

If gh-pages is executed via a named script, the command needs to be modified slightly (note the -- to pass the additional argument to the wrapped gh-pages call). Maybe this should be included as another example.

"scripts": {
   "deploy": "gh-pages -d build"
}
npm run deploy -- -u "github-actions-bot <support+actions@github.com>"

@mickelsonmichael
Copy link
Contributor Author

@phibo23 sorry for the enormous delay on getting back to you on this. I'd like to implement those changes, but it looks like I must have carelessly deleted my fork already and can't figure out how to add the changes.

Will I have to merge then create a second PR or is there a way to edit still?

@phibo23
Copy link

phibo23 commented Feb 26, 2021

no worries, delays happen on github all the time 😅
I guess you could try the github cli. but I've never used that before.
Bildschirmfoto 2021-02-26 um 20 21 48

@mickelsonmichael
Copy link
Contributor Author

@phibo23 was able to get the gh-cli to open the PR, but wasn't able to properly associate the commits with the PR. I have recreated and updated a new fork with the changes you requested, but it may require a new PR altogether, since I don't seem to be able to update this Pull Request

@mickelsonmichael
Copy link
Contributor Author

See #378 for the fixed PR

brenthaertlein added a commit to brenthaertlein/Fallout-4-Character-Planner that referenced this pull request Jul 17, 2021
z720 added a commit to z720/qrcode-generator that referenced this pull request Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants