Add zero-config build path for Node.js apps - #25
Open
runleveldev wants to merge 8 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a build path to LaunchPad so a Node.js repo can be deployed with zero configuration, while keeping the existing pre-built-image path. When
template_nameis omitted on a manage event, LaunchPad now builds the checked-out repo into a systemd-enabled image, pushes it toghcr.io/<owner>/<repo>/launchpad:<sha>, and deploys it.This PR contains two logical parts:
1. Refactor: dispatcher + sub-actions (no behavior change)
The monolithic
action.ymlis split into a dispatcher plus three composite sub-actions, referenced via the self-repo$/manage/$/delete/$/buildsyntax (resolves this repo at the running commit):manage/— create/recreate the container and report statusdelete/— remove the container on branch delete / PR closebuild/— build & push the application image2. Build path
build/Dockerfile— a default lifecycle image based onghcr.io/mieweb/opensource-server/docker-nodejs:latest. Stages: Dependencies (dependency_command) → Configure/Build (build_command) → Install (copy repo + install & enable the unit) → Run (run_commandviaapp.service).build/app.service.in— systemd unit template rendered withenvsubst(explicit variable allow-list, so values like$PORTsurvive verbatim).Documentation=is set to the repo URL; env vars load from/etc/environment.image,base_image,working_directory,dependency_command,build_command,run_command. New output:image..github/workflows/test.yml): validates all action metadata, lints workflows, and runs a fixture build test asserting the rendered/enabled unit.Breaking change
Previously, omitting
template_nameon a manage event reused an existing container as-is. It now builds and deploys from the repository. Cleanup events (PR close / branch delete) are unaffected — they never build.Caller requirements (build mode)
actions/checkoutbefore the actionpermissions: contents: read, packages: writeTesting
action-validatorpasses on all fouraction.ymlfilesactionlintcleantest/build-test.shpasses both scenarios (defaults + overrides); verifiedWorkingDirectory,ExecStart,Documentationsubstitution, themulti-user.target.wantsenable symlink, and$PORTverbatim survival