-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
📘 DOC: Adding github actions example to deploy.md #823
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). astro-docs – ./docs🔍 Inspect: https://vercel.com/pikapkg/astro-docs/DJKSfZSV6gJA2xjWFJUGtF2bUNVx astro-www – ./www🔍 Inspect: https://vercel.com/pikapkg/astro-www/8NW27rEhKequtdwDdwKWuNkFjb9W |
This looks pretty great! |
docs/src/pages/guides/deploy.md
Outdated
1. Set the correct `buildOptions.site` in `astro.config.mjs` | ||
2. Create the file `.github/workflows/main.yml` and add in the yaml bellow. Make sure to edit in your own details. | ||
3. In Github go to Settings > Developer settings > Personal Access tokens. Generate a new token with repo permissions. | ||
4. In your Github source code repo (not \<YOUR USERNAME\>.github.io) go to Settings > Secrets and add your new personal access token with the name `API_TOKEN_GITHUB`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line confused me. what does "your github source code repo" mean? maybe "the astro project repo" instead?
docs/src/pages/guides/deploy.md
Outdated
source-directory: 'dist' | ||
destination-github-username: '<YOUR USERNAME>' | ||
destination-repository-name: '<YOUR USERNAME>.github.io' | ||
user-email: <YOUR GITHUB EMAIL> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing that could help: can you move these into variables somewhere at the top of the file, so that users have 1 place to edit values?
Also, can some of these be auto-detected, like github.actor
? Just found this list here: https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context
Made the suggested changes
Thanks for the suggestions, I think you are definitely right with the wording of the project repo, just wanted to make sure it couldn't be confused for the deployment repo.
Thank you :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once you've merged the two suggestions made by @jasikpark and myself!
Co-authored-by: Caleb Jasik <[email protected]> Co-authored-by: Fred K. Schott <[email protected]>
I've applied the changes you & @jasikpark suggested, thank you both very much for your help. |
no problem, thanks for adding this! It's a great addition |
Changes
Added an example of a Github actions workflow in the deploy.md docs for github pages that pushes changes to <YOUR USERNAME>.github.io.
Testing
The yaml example code was tested on my personal repo, changes proposed here are only in the deploy.md Docs.
Docs
Yes, I added an example under the Github Actions heading in deploy.md.
Thank you, hope this is helpful.