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

Proposition: automate build and deploy with GitHub actions #151

Open
alexander-ding opened this issue May 26, 2020 · 2 comments
Open

Proposition: automate build and deploy with GitHub actions #151

alexander-ding opened this issue May 26, 2020 · 2 comments

Comments

@alexander-ding
Copy link
Collaborator

I've been experimenting with GitHub actions to setup workflows that trigger when you, say, push to the master branch. Specifically, we can setup an action to

  1. Build the HTML from source every time new material is pushed
  2. Backup the current HTML as an Artifact (available for download), which would allow us to get rid of docs_backup

Another potential change an automated action can open us up to is the separation of source and generated code. Since you don't have to manually deploy both rounds of code, storing them on separate branches becomes very feasible. Personally, I think having the HTML available on the default branch clutters the commit history and distracts the developers. Since GitHub's hosting service only allows you to deploy from the master branch, you can deploy your source code to a different branch (say, source) and make it the repository's default branch, while hosting from the master branch. This is the setup I've been using for my personal website, and it works like a charm. In order to make a change, all I need to do is to push the update of my source code to the source branch, and the website will update automatically.

Obviously, this would be a significant restructure of the repository, so I'm just pitching the idea here. I think it'd be very worthwhile.

@rsokl
Copy link
Owner

rsokl commented May 28, 2020

I really like this idea and agree that it would be worthwhile. I would like to add some CI, like a link-checker (#67), that would gate PRs as well.

I think that my only hang-ups are:

  • I would not be able to view the HTML that actually got built before it goes live. That is, there could be a discrepancy between the environment I am using to build the site vs environment used by GitHub actions
  • There is that and the potential overhead of wanting to upgrade the tech stack for the website, but having do surgery on the actions instead of simply experimenting with my own local environment. Perhaps it is simple enough to finalize whatever tweaks I am doing and simply revise the environment for the actions.

Any thoughts on this?

@alexander-ding
Copy link
Collaborator Author

I would not be able to view the HTML that actually got built before it goes live. That is, there could be a discrepancy between the environment I am using to build the site vs environment used by GitHub actions

I don't think there would be too much real difference between the HTML you build locally (using conda) and the HTML GitHub builds if you setup the GitHub action to create a similar environment to your local machine (Windows 10 image, Conda, create-env from the .yaml file in the repo). I did some research, and there are already actions on the GitHub market that supports this sort of setup (see setup-conda). Even if you absolutely need to verify the build, there are tools (see act) that allow you to run the actions locally.

There is that and the potential overhead of wanting to upgrade the tech stack for the website, but having do surgery on the actions instead of simply experimenting with my own local environment. Perhaps it is simple enough to finalize whatever tweaks I am doing and simply revise the environment for the actions.

In my experience it's not much work to revise the environment once you've got the setup figured out locally.

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

No branches or pull requests

2 participants