Skip to content

Add GitHub Actions workflow#173

Draft
pedrogaudencio wants to merge 62 commits into
masterfrom
deploy-workflow
Draft

Add GitHub Actions workflow#173
pedrogaudencio wants to merge 62 commits into
masterfrom
deploy-workflow

Conversation

@pedrogaudencio

@pedrogaudencio pedrogaudencio commented Mar 29, 2026

Copy link
Copy Markdown
Collaborator
  • automate building and deploying Forkana to a VM via SSH
  • validate deployment prerequisites (secrets, commit SHA)
  • trigger deploy.sh on the remote server with the commit to deploy
  • support both push-triggered and manual workflow dispatch with optional commit SHA override for rollback scenarios

Closes #148
Depends on #128

Co-authored by: Claude Opus 4.6, Opus 4.7

* create Dockerfile based on rootless variant
…r, systemd WorkingDirectory

* add  to Dockerfile custom-defaults loop so Forkana CSS/images are baked in
* change nginx.conf placeholder from dev.forkana.org to dev.forkana.example (RFC 2606),
  making the deployment guide's sed command match correctly
* fix systemd WorkingDirectory: ~/... → %h/... (systemd does not expand tilde)
* add FORKANA_INTERNAL_TOKEN and FORKANA_JWT_SECRET to .env.example and wire them via GITEA__ env overrides in dev.yml
* initialize CONF_ARG=() before arg-parsing loop in gitea wrapper to prevent errors under set -u
* Copy all four deploy scripts (deploy.sh, deploy_common.sh,
  deploy_debian.sh, deploy_fedora.sh) instead of only deploy.sh,
  which would break the OS-detection wrapper at runtime
* Replace %h with absolute path in systemd unit WorkingDirectory,
  since %h resolves to root's home in system-level units
* Add missing sudo to setsebool SELinux command
* Align SSH security notes and checklist with the actual 'restrict'
  keyword used in the authorized_keys example
* pin the Docker network subnet to 172.30.0.0/16 in dev.yml so Docker always assigns a deterministic subnet instead of allocating dynamically from unpredictable ranges
* update the app.ini template to trust exactly the pinned subnet (127.0.0.0/8,::1/128,172.30.0.0/16) instead of the overly broad '*'
* migrate plain environment variables to GITEA__section__KEY format so changes take effect on every container restart,
not just first boot
* update app.ini template with hardcoded defaults and cleaned up docker-setup.sh validation logic
* prevent silent failures on image tag mismatch by making the script exit with an error if neither expected tag is found in the loaded tarball
* remove dead LOCAL_MODE variable and update its associated comments
* update header comments in OS-specific deploy scripts to accurately reflect the new tarball-loading architecture instead of build-on-server
* rewrite the 'Local testing' section to document the required steps for building and saving the tarball manually before running the deploy script locally
@pedrogaudencio pedrogaudencio changed the base branch from master to docker-deploy April 20, 2026 18:22
Base automatically changed from docker-deploy to master April 28, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitHub Actions workflow to trigger deployment on master updates

1 participant