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

📘 DOC: Adding github actions example to deploy.md #823

Merged
merged 3 commits into from
Jul 23, 2021
Merged

📘 DOC: Adding github actions example to deploy.md #823

merged 3 commits into from
Jul 23, 2021

Conversation

danny-burrows
Copy link
Contributor

@danny-burrows danny-burrows commented Jul 22, 2021

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.

@changeset-bot
Copy link

changeset-bot bot commented Jul 22, 2021

⚠️ No Changeset found

Latest commit: 20abe91

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jul 22, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

astro-docs – ./docs

🔍 Inspect: https://vercel.com/pikapkg/astro-docs/DJKSfZSV6gJA2xjWFJUGtF2bUNVx
✅ Preview: https://astro-docs-git-fork-danny-burrows-patch-2-pikapkg.vercel.app

astro-www – ./www

🔍 Inspect: https://vercel.com/pikapkg/astro-www/8NW27rEhKequtdwDdwKWuNkFjb9W
✅ Preview: https://astro-www-git-fork-danny-burrows-patch-2-pikapkg.vercel.app

@jasikpark
Copy link
Contributor

This looks pretty great!

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`.
Copy link
Member

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?

source-directory: 'dist'
destination-github-username: '<YOUR USERNAME>'
destination-repository-name: '<YOUR USERNAME>.github.io'
user-email: <YOUR GITHUB EMAIL>
Copy link
Member

@FredKSchott FredKSchott Jul 23, 2021

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
@danny-burrows
Copy link
Contributor Author

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.

  • I also added a env section and minimized the amount of changes needed to the script.
  • I kept the deployment repo name as input so you can still deploy to any project github page.

Thank you :)

Copy link
Member

@FredKSchott FredKSchott left a 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!

docs/src/pages/guides/deploy.md Outdated Show resolved Hide resolved
Co-authored-by: Caleb Jasik <[email protected]>
Co-authored-by: Fred K. Schott <[email protected]>
@danny-burrows
Copy link
Contributor Author

I've applied the changes you & @jasikpark suggested, thank you both very much for your help.

@FredKSchott
Copy link
Member

no problem, thanks for adding this! It's a great addition

@FredKSchott FredKSchott merged commit b5fed3b into withastro:main Jul 23, 2021
xstevenyung pushed a commit to xstevenyung/astro that referenced this pull request Oct 17, 2023
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.

3 participants