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

Github action: add deploy workflow #163

Merged
merged 2 commits into from
Jan 5, 2021

Conversation

junghans
Copy link
Contributor

This will automatically deploy the page when pushing to source branch (i.e. master and source).
That basically allows editing through the GitHub web interface, no more need to install bundler locally.

This also supports pull requests, which can be useful to collaboratively make a conference page. For PRs the whole build is still done except the actual git push at the end. To achieve this I added a --dry-run option to bin/deploy.

Side notes:

  • added --verbose option to make debugging of bin/deploy easier
  • changed the exit code for unknown options to 1, before it would end gracefully (exit 0)
  • fixed --user option calling shift twice
  • using actions/cache to cache bundle
  • the current branch is always used as the source branch, however the deploy action is only triggered for master / source (and PR to these, but PR are not deployed).
  • in case of a .github.io repo, the deploy branch is switched from gh-pages to master.
  • all the GitHub action stuff is pretty easy to customize
  • all changes to bin/deploy are backward compatible

@alshedivat
Copy link
Owner

@junghans, this is awesome, thanks for the contribution!

Overall, LGTM. Before merging this PR, let me play with the config to make sure it takes care of all / most of use cases.

Copy link
Owner

@alshedivat alshedivat left a comment

Choose a reason for hiding this comment

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

LGTM.

Could you please explain and document the logic of this workflow a bit more by answering a couple of questions I left inline? I'd be happy to merge after that. Thanks.

bin/deploy Show resolved Hide resolved
.github/workflows/deploy.yml Show resolved Hide resolved
bin/deploy Show resolved Hide resolved
.github/workflows/deploy.yml Outdated Show resolved Hide resolved
bin/deploy Show resolved Hide resolved
@alshedivat alshedivat merged commit 625fb69 into alshedivat:master Jan 5, 2021
github-actions bot added a commit that referenced this pull request Jan 5, 2021
* Github action: add deploy workflow

* Update .github/workflows/deploy.yml

Co-authored-by: Maruan <[email protected]> [ci skip]
@junghans junghans deleted the github-action branch January 5, 2021 01:17
song-qun pushed a commit to song-qun/song-qun.github.io that referenced this pull request Mar 19, 2021
* Github action: add deploy workflow

* Update .github/workflows/deploy.yml

Co-authored-by: Maruan <[email protected]>
abojchevski pushed a commit to abojchevski/abojchevski.github.io that referenced this pull request May 16, 2021
* Github action: add deploy workflow

* Update .github/workflows/deploy.yml

Co-authored-by: Maruan <[email protected]>
MichaelHilton pushed a commit to MichaelHilton/MichaelHilton.github.io that referenced this pull request Jul 22, 2021
* Github action: add deploy workflow

* Update .github/workflows/deploy.yml

Co-authored-by: Maruan <[email protected]>
clandais pushed a commit to clandais/clandais.github.io that referenced this pull request Oct 13, 2023
This fixes issues mentioned in alshedivat#163
antchristou pushed a commit to antchristou/antchristou.github.io that referenced this pull request Nov 20, 2023
* Github action: add deploy workflow

* Update .github/workflows/deploy.yml

Co-authored-by: Maruan <[email protected]>
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.

2 participants