{"id":16560057,"url":"https://github.com/dzikoysk/preview-deployments","last_synced_at":"2026-04-25T08:35:40.389Z","repository":{"id":195274969,"uuid":"669131102","full_name":"dzikoysk/preview-deployments","owner":"dzikoysk","description":"My personal kubernetes-free utility preview deployments manager for GitHub-based monorepos","archived":false,"fork":false,"pushed_at":"2023-09-16T15:51:52.000Z","size":127,"stargazers_count":2,"open_issues_count":14,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-02T01:19:26.675Z","etag":null,"topics":["github","preview-deploy","preview-environment"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dzikoysk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-21T12:19:40.000Z","updated_at":"2024-05-27T03:24:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"471c2b48-00f0-4bc6-913d-897baa71004b","html_url":"https://github.com/dzikoysk/preview-deployments","commit_stats":null,"previous_names":["dzikoysk/preview-deployments"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dzikoysk/preview-deployments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikoysk%2Fpreview-deployments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikoysk%2Fpreview-deployments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikoysk%2Fpreview-deployments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikoysk%2Fpreview-deployments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dzikoysk","download_url":"https://codeload.github.com/dzikoysk/preview-deployments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzikoysk%2Fpreview-deployments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32255645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T04:23:17.126Z","status":"ssl_error","status_checked_at":"2026-04-25T04:21:53.360Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","preview-deploy","preview-environment"],"created_at":"2024-10-11T20:27:56.138Z","updated_at":"2026-04-25T08:35:40.360Z","avatar_url":"https://github.com/dzikoysk.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Preview Deployments\n\n![Dashboard](https://cdn.discordapp.com/attachments/691990250578247710/1152625433687380120/268455881-447a2db5-5b0a-4d88-b42d-0c9c1be69480.png)\n\nMy personal kubernetes-free utility preview deployments manager for GitHub mono-repositories. \nConvenient way to manage preview deployments for smaller projects/prototypes.\nInspired by Vercel's [Preview Deployments](https://vercel.com/docs/platform/deployments#preview-deployments) integration.\n\n```bash\n$ java -jar app.jar \u003cport=8080\u003e \u003cusername=admin\u003e \u003cpassword=admin\u003e \u003cpath=preview.yml\u003e\n```\n\n**Requirements**:\n* Java 17\n* Nginx\n* Linux\n\n### Features\n\n* Clones repository from GitHub _(private/public)_\n* Exposes webhooks for GitHub _(push, pull_request)_\n* Declarative configuration file with support for dynamic variables\n* Supports multiple branches\n* Supports multiple services per branch\n* Start/stop handled by native commands\n* Automatically generates \u0026 reloads nginx configuration\n\n### Configuration\nAssuming we have some `that-app` project with a following structure:\n\n* `thatapp-backend` - Backend in Java, built with Gradle\n* `thatapp-frontend` - Frontend app, built with NPM\n* PostgreSQL\n\nGit repository:\n\n```bash\nthat-app/\n├── thatapp-backend/\n│   ├── gradlew\n├── thatapp-frontend/\n│   ├── package.json\n```\n\nThe `preview.yml` configuration file should look like this:\n\n```yaml\ngeneral:\n  hostname: \"preview.thatapp.com\"                                # Root domain for preview deployments\n  port-range: \"11010-12000\"                                      # Available ports for all services\n  working-directory: \"./that-app\"                                # App working directory (useful for multiple preview deployments instances on the same machine)\n  nginx-config: \"/etc/nginx/sites-enabled/thatapp-preview.conf\"  # Nginx's configuration file that will be managed by this instance\n  git-source: \"git@github.com:dzikoysk/thatapp.git\"              # Sources that will be cloned\n  ssh-key: \"/home/dzikoysk/.ssh/github_dzikoysk_thatapp\"         # Configured SSH key that will be used to clone repository\nbranches:\n  \"*\": \"preview\"  # You can list multiple branches by name or use a wildcard (*). \nvariables: # Variables that can be used in pre/services sections \n  \"env-id\": \"id()\"\n  \"preview-url\": \"url()\"\n  \"backend-port\": \"port()\"\n  \"backend-dir\": \"thatapp-backend\"\n  \"frontend-port\": \"port()\"\n  \"frontend-dir\": \"thatapp-frontend\"\n  \"postgres-port\": \"port()\"\npre:\n  commands: # Commands that will be executed before starting services\n    - \"docker pull postgres:latest\"\n    - \"chmod +x ./${backend-dir}/gradlew\"\nservices: # List of services that will be started for each branch\n  \"postgres\": # Service name\n    start-commands: # Start the service, e.g. run docker container\n      - \"docker run --name postgres${env-id} -p ${postgres-port}:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres -d postgres\"\n    stop-commands: # Stop \u0026 cleanup service\n      - \"docker stop postgres${env-id}\"\n      - \"docker rm postgres${env-id}\"\n  \"backend\":\n    source: \"./${backend-dir}\" # Path to service sources (relative to working directory)\n    public: # Public URL configuration\n      port: \"${backend-port}\"\n      url: \"api.${preview-url}:80\"\n    start-commands:\n      - \"./gradlew build -x integrationTest --no-daemon \u0026\u0026 java -jar build/libs/thatapp-backend-0.0.1-SNAPSHOT.jar\"\n    stop-commands:\n      - \"$exit\"\n    environment: # Environment variables that will be passed to service\n      \"SERVER_PORT\": \"${backend-port}\"\n      \"SPRING_PROFILES_ACTIVE\": \"prod\"\n      \"FRONTEND_URL\": \"${preview-url}\"\n      \"DATABASE_URL\": \"jdbc:postgresql://localhost:${postgres-port}/postgres\"\n      \"POSTGRES_DB_USER\": \"postgres\"\n      \"POSTGRES_DB_PASSWORD\": \"postgres\"\n  \"frontend\":\n    source: \"./${frontend-dir}\"\n    public:\n      port: \"${frontend-port}\"\n      url: \"${preview-url}:80\"\n    start-commands:\n      - \"npm install \u0026\u0026 npm run build \u0026\u0026 npm run start -- -p ${frontend-port}\"\n    stop-commands:\n      - \"$exit\"\n    environment:\n      \"NODE_ENV\": \"production\"\n      \"API_URL\": \"api.${preview-url}:${backend-port}\"\n```\n\n### Environment variables functions\n\n* `id()` - Generates unique id for each preview deployment\n* `url()` - Returns preview deployment url\n* `port()` - Returns available port for service (each call returns different port)\n\n### Notes\n\nIncrease `server_names_hash` in `/etc/nginx/nginx.conf` to properly handle long server names:\n\n```\nserver_names_hash_bucket_size  256;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzikoysk%2Fpreview-deployments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdzikoysk%2Fpreview-deployments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzikoysk%2Fpreview-deployments/lists"}