Automatic pushing to Dreamhost from Github via Workflows #19166
|
Recently transitioned hosting my website to Dreamhost from Netlify in order to host a dynamic site. One thing I miss is the ability to automatically deploy from Github to the hosting service when changes are detected in my repo. I've found tutorials for pushing to Github from my Dreamhost server, but not the other way around. I have multiple people working on this website, and my hope is to do this centrall via Github instead of manually pushing to both Github and the Dreamhost server thru the command line. My assumption is that to ssh to Dreamhost I need a public key from my client to store on the Dreamhost server. I don't know if this is possible to generate a public key from Github (related to the workflow), but if it is how I would I do it? The other option is to store the ssh credentials with Github repo secrets to connect, but I feel this isn't best practice. How would I go about pushing my Github repo to my Dreamhost server automatically after changes to main? |
Replies: 1 comment
|
Create a bare repo on the DreamHost server What remains for your GitHub Action is, as described in (https://zellwk.com/blog/github-actions-deploy/), to use a dedicated SSH key, whose private key is registered in GitHub secrets |
Create a bare repo on the DreamHost server
and push it to it
have a post-receive hook doing the git restore in the target folder (on the same server) where the actual site is deployed
See (https://stackoverflow.com/a/68246767/6309)"
What remains for your GitHub Action is, as described in (https://zellwk.com/blog/github-actions-deploy/), to use a dedicated SSH key, whose private key is registered in GitHub secrets