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

Setup CI/CD for the Pull requests #73

Open
jcubic opened this issue Apr 6, 2024 · 10 comments
Open

Setup CI/CD for the Pull requests #73

jcubic opened this issue Apr 6, 2024 · 10 comments

Comments

@jcubic
Copy link
Contributor

jcubic commented Apr 6, 2024

It would be nice to have GitHub workflow that will build and upload the file to the server. It will make it easier to manage. When this is done for this repo it could be replicated for different repositories.

This is continuation of discussion in #43

@jcubic
Copy link
Contributor Author

jcubic commented Apr 6, 2024

How this script know the password and username? I never used rsync to copy to an external server (I only use to backup files locally), but I think to use SSH you need some extra stuff in the command.

<https://github.com/schemedoc/docs.scheme.org/blob/master/scripts/upload.sh>

@lassik
Copy link
Member

lassik commented Apr 6, 2024

We don't use passwords; we use SSH key pairs only. GitHub probably has some place for a "deploy key"?

@arthurgleckler
Copy link
Contributor

arthurgleckler commented Apr 6, 2024 via email

@lassik
Copy link
Member

lassik commented Apr 6, 2024

You don't need any extra stuff in the command. The SSH client on your computer knows your keypair and uses it.

@lassik
Copy link
Member

lassik commented Apr 6, 2024

Documentation on deploy keys

On sexond thought, it might be easier if our server pulls the git repo and starts a Docker container to build the site. The CI action would only have to notify the server via a special HTTP endpoint.

@jcubic
Copy link
Contributor Author

jcubic commented Apr 6, 2024

I use secrets for this. The link you provided is how to set up git locally with SSH.

ALso github actions already use Docker images (at least I think they use docker) but if you want to do this on the server then you will need to setup everything on the server.

To trigger the build you can use web hooks. I have it in one project.

@arthurgleckler
Copy link
Contributor

ALso github actions already use Docker images (at least I think they use docker) but if you want to do this on the server then you will need to setup everything on the server.

We serve the pages from our own server, so we'd have to get the result of any build done on Github to our server, anyway. At that point, doing the build on our server is just fine.

@jcubic
Copy link
Contributor Author

jcubic commented Apr 7, 2024

The problem with building on the server is that we can't test if the build pass and show error if this doesn't happen on GitHub. If we have built that fails, GitHub will send an email and show that there is an error. Also, we can run build without deploy when PR is created. This will make sure that someone didn't put something that break the build (e.g. happen by a typo).

@lassik
Copy link
Member

lassik commented Apr 15, 2024

We should gradually reduce the dependency on GitHub, not increase it. Docker is a good tool for this, since the containers work the same way on different GIt hosts and also on a Linux server. I would prefer if each repo has a Containerfile and a build script that runs in that container. If we have that, we can do builds on both GitHub CI and our server as needed.

(Pull requests can be checked by GitHub CI without uploading the build products. Pushes to master can either be rsynced to the server or the server can be notified via HTTP to fetch them.)

@arthurgleckler
Copy link
Contributor

arthurgleckler commented Apr 15, 2024 via email

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

3 participants