{"id":34672199,"url":"https://github.com/hirurg-lybitel/docker-server-with-github-actions","last_synced_at":"2026-04-16T05:04:41.776Z","repository":{"id":199366274,"uuid":"702491534","full_name":"hirurg-lybitel/docker-server-with-github-actions","owner":"hirurg-lybitel","description":"Deploying a simple server on a remote machine","archived":false,"fork":false,"pushed_at":"2023-10-10T17:37:39.000Z","size":14347,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-10-11T00:20:58.303Z","etag":null,"topics":["docker","docker-compose","esbuild","github-actions","node","pm2","ssh","workflows","yarn3"],"latest_commit_sha":null,"homepage":"http://213.184.249.125:60103","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hirurg-lybitel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-09T12:22:46.000Z","updated_at":"2023-10-10T13:21:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"56c750cf-bb82-4198-8a69-a2d26c3893b1","html_url":"https://github.com/hirurg-lybitel/docker-server-with-github-actions","commit_stats":null,"previous_names":["hirurg-lybitel/docker-server-with-github-actions"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/hirurg-lybitel/docker-server-with-github-actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirurg-lybitel%2Fdocker-server-with-github-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirurg-lybitel%2Fdocker-server-with-github-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirurg-lybitel%2Fdocker-server-with-github-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirurg-lybitel%2Fdocker-server-with-github-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirurg-lybitel","download_url":"https://codeload.github.com/hirurg-lybitel/docker-server-with-github-actions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirurg-lybitel%2Fdocker-server-with-github-actions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31872036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","docker-compose","esbuild","github-actions","node","pm2","ssh","workflows","yarn3"],"created_at":"2025-12-24T19:59:32.326Z","updated_at":"2026-04-16T05:04:41.771Z","avatar_url":"https://github.com/hirurg-lybitel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy server with github actions\n\nThis example illustrates how to set up automatic build and deployment of a docker image on your remote server by [GitHub Acions]([url](https://docs.github.com/en/actions)).\n\nView the result on the [demo server](http://213.184.249.125:60103).\n\nThere're three main points here:\n\n1.  Node App\n2.  GitHub-actions\n3.  Remote machine\n\n## Node App\n\nThere is a few ways to run app locally:\n\n- by node\n```\nyarn launch\n```\n- by pm2\n```\nyarn pm2:start\n```\n- by docker\n```\ndocker compose up\n```\n\n## GitHub Actions\n\n**Here you need to set several mandatory secrets for your repository (_Settings -\u003e Secrets and variables -\u003e Actions_):**\n- **DOCKER_*** - your Docker Hub credentials;\n- **DEPLOY_*** - SSH data for connection to your remote machine.\n\n![image](https://github.com/hirurg-lybitel/docker-server-with-github-actions/assets/11502258/8570afe8-0d7e-4c4f-9363-f0d87a3b9bec)\n\n\n**After push cahnges to github on **main** branch go to Actions tab of your repository:**\n\n![image](https://github.com/hirurg-lybitel/docker-server-with-github-actions/assets/11502258/99166911-6f8d-4340-ac88-62fb88ef0ca7)\n\n**Two tasks will appear here which will:**\n1. check your code\n2. build a docker image\n3. upload it to GitHub Container Registry (GitHub alternative to Docker)\n4. connect to your remote server\n5. deploy the built image on it\n\n\n## Remote machine*\n*change path _workspace/Yuri/test_ in [docker-deploy.yml](https://github.com/hirurg-lybitel/docker-server-with-github-actions/blob/main/.github/workflows/docker-deploy.yml) to your path.\n\nIn addition to setting up ssh and port forwarding, several files are needed here:\n- .env\n- docker-compose.run.yml\n- run_container.sh\n  \n![image](https://github.com/hirurg-lybitel/docker-server-with-github-actions/assets/11502258/4db9191d-e3f0-48fe-a2da-9df41e440016)\n\n### .env\n\nSee [.env.sample](https://github.com/hirurg-lybitel/docker-server-with-github-actions/blob/main/.env.sample) and enter your data.\n\n### docker-compose.run.yml\n\nDocker compose file for creating and running container:\n\n```yml \nversion: \"3.8\"\nservices:\n  server:\n    image: ghcr.io/hirurg-lybitel/docker-server-with-github-actions:main    \n    build:\n      context: .\n      dockerfile: Dockerfile\n      target: server\n      args:\n        - PM2_PUBLIC_KEY=${PM2_PUBLIC_KEY}\n        - PM2_SECRET_KEY=${PM2_SECRET_KEY}\n    container_name: simple_server\n    ports:\n      - \"${PORT}:${PORT}\"\n    env_file:\n      - ./.env\n```\n\n### run_container.sh\n\nBash script for calling docker compose:\n\n```bash\ndocker compose -f docker-compose.run.yml --env-file .env up -d\n```\n\n## PM2 monitoring\nAfter launching project locally [by pm2](#node-app) or deploying it on remote server you will able to monitor your server in [PM2 dashboard](https://id.keymetrics.io/api/oauth/register):\n\n![image](https://github.com/hirurg-lybitel/docker-server-with-github-actions/assets/11502258/090356ff-f230-4b3a-920c-cbb3822a9b94)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirurg-lybitel%2Fdocker-server-with-github-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhirurg-lybitel%2Fdocker-server-with-github-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirurg-lybitel%2Fdocker-server-with-github-actions/lists"}