Comment on CI/CD question: How do you actually deploy a self-hosted web app that runs in docker (preferably using Forgejo actions)?

possiblylinux127@lemmy.zip ⁨5⁩ ⁨days⁩ ago

First make make a script that deploys it. Then convert that script into a workflow. In the end your workflow will be 4 steps:

  1. Checkout the repo
  2. Build app
  3. Create SSH key
  4. Copy to host and restart service

For the SSH key I would encode it via base64 before storing it as a forgejo secret. You can do via something like this:

cat private.key | base64 -w 0

And then in your workflow

echo $APP_SSH_KEY | base64 -d > ~/.ssh/id_ed25519 (assuming you use ed25519 which is the default key)

original
Sort:hotnewtop