{"id":20520799,"url":"https://github.com/vaibhavyadav-dev/setup-server","last_synced_at":"2026-04-15T20:31:50.424Z","repository":{"id":262277625,"uuid":"886756154","full_name":"vaibhavyadav-dev/setup-server","owner":"vaibhavyadav-dev","description":"Custom Action that setup server for deployment of BharatSeva+ backend.","archived":false,"fork":false,"pushed_at":"2024-11-15T11:15:50.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-06T23:12:14.441Z","etag":null,"topics":["backend","cicd","custom-actions","devops"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/vaibhavyadav-dev.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-11T14:48:02.000Z","updated_at":"2024-11-15T11:16:52.000Z","dependencies_parsed_at":"2024-11-15T12:34:16.437Z","dependency_job_id":null,"html_url":"https://github.com/vaibhavyadav-dev/setup-server","commit_stats":null,"previous_names":["vaibhavyadav-dev/setup4bharatseva","vaibhavyadav-dev/setup-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vaibhavyadav-dev/setup-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavyadav-dev%2Fsetup-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavyadav-dev%2Fsetup-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavyadav-dev%2Fsetup-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavyadav-dev%2Fsetup-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaibhavyadav-dev","download_url":"https://codeload.github.com/vaibhavyadav-dev/setup-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaibhavyadav-dev%2Fsetup-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31859233,"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":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: 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":["backend","cicd","custom-actions","devops"],"created_at":"2024-11-15T22:23:07.233Z","updated_at":"2026-04-15T20:31:50.391Z","avatar_url":"https://github.com/vaibhavyadav-dev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Setup-Server\nThis GitHub Action allows for automated deployment to a remote server based on specific commit messages. It is designed to set up and deploy a server directory only when a commit message follows the pattern:\n```deploy - h SERVER_IP - u USER```.\n\n## Usage\n### Prerequisites\n1. **Add SSH Key:** Add your private SSH key to the repository secrets as `SSH_KEY`.\n2. **Commit Message Format:** Use the following format to trigger deployment:\n  ```bash\n  deploy - h SERVER_IP - u USER\n  ```\nReplace:\n- `SERVER_IP`: The IP address of the target server.\n- `USER`: The username to SSH into the server.\n\n---\n### Example Workflow\n\n```yaml\nname: custom\non:\npush:\n branches:\n   - main\n\njobs:\nmain:\n runs-on: ubuntu-latest\n steps:\n   - name: Checkout Repository\n     uses: actions/checkout@v3\n\n   - name: Check Commit Message for Deployment\n     id: check_message\n     run: |\n       # Check if the commit message matches the deployment pattern\n       if [[ \"${{ github.event.head_commit.message }}\" =~ deploy\\ -\\ h\\ ([0-9]{1,3}\\.){3}[0-9]{1,3}\\ -\\ u\\ [a-zA-Z0-9_]+ ]]; then\n         echo \"Deployment commit detected. Extracting SERVER_IP and USER...\"\n         SERVER_IP=$(echo \"${{ github.event.head_commit.message }}\" | grep -oP \"(?\u003c=deploy - h )([0-9]{1,3}\\.){3}[0-9]{1,3}\")\n         USER=$(echo \"${{ github.event.head_commit.message }}\" | grep -oP \"(?\u003c=- u )[a-zA-Z0-9_]+\")\n         echo \"SERVER_IP=${SERVER_IP}\" \u003e\u003e $GITHUB_ENV\n         echo \"SSH_USER=${USER}\" \u003e\u003e $GITHUB_ENV\n       else\n         echo \"No valid deployment commit detected. Skipping deployment.\"\n         exit 0\n       fi\n\n   - name: Run Setup for Bharat Seva\n     # if any of SERVER_IP or SSH_USER is present then it will be executed\n     # instead SSH_HOST or SSH_USER will be used inplace\n     if: env.SERVER_IP != '' \u0026\u0026 env.SSH_USER != ''\n     uses: vaibhavyadav-dev/setup-server@main\n     env:\n       SSH_KEY: ${{ secrets.SSH_KEY }}\n       SSH_USER: ${{ env.SSH_USER }}\n       SSH_HOST: ${{ env.SERVER_IP }}\n```\n\n### How It Works\nTriggering the Workflow:\n\nThe workflow runs whenever a push is made to the main branch.\nCommit Message Validation:\nThe workflow checks if the latest commit message follows the format:\n```bash\ndeploy - h SERVER_IP - u USER\n```\nIf the format matches:\nExtracts SERVER_IP (the server's IP address) and USER (the SSH username).\nThese values are set as environment variables for the subsequent steps.  \n\nDeployment Execution:\nThe Setup-Server action connects to the specified server using the extracted SERVER_IP and USER.  \nSets up the server directory and installs required packages like Docker and Docker Compose.\n\n### Skipping Deployment:\nIf the commit message does not match the required format, the workflow exits without running further steps.  \nSecrets Configuration\n\n### Make sure to configure the following secrets in your GitHub repository:\nSecret Name\tDescription\n- SSH_KEY\tPrivate SSH key for connecting to the server.\n- SSH_USER\tDefault SSH username (optional fallback).\n- SSH_HOST\tDefault SSH host (optional fallback).  \n\n### Commit Message Format  \nTo trigger the deployment, use a commit message like this:\n\n```bash\n  deploy - h 192.168.1.10 - u azureuser\n```\nSERVER_IP: The target server's IP address.\nUSER: The SSH username to connect to the server.\n## Notes\nEnsure the target server has SSH access enabled and the provided SSH key is authorized.\nModify the workflow to suit your specific deployment requirements.\n## License\nThis action is licensed under the MIT License. Feel free to use and modify it!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhavyadav-dev%2Fsetup-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaibhavyadav-dev%2Fsetup-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhavyadav-dev%2Fsetup-server/lists"}