{"id":31787318,"url":"https://github.com/jgraichen/deploy","last_synced_at":"2025-10-10T13:58:23.848Z","repository":{"id":298765688,"uuid":"1001072432","full_name":"jgraichen/deploy","owner":"jgraichen","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-06T05:51:21.000Z","size":10,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T07:27:06.882Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/jgraichen.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-12T19:18:52.000Z","updated_at":"2025-10-06T05:51:23.000Z","dependencies_parsed_at":"2025-06-12T21:02:45.392Z","dependency_job_id":"cc27c956-7768-4115-ba1f-54ff1b71a74e","html_url":"https://github.com/jgraichen/deploy","commit_stats":null,"previous_names":["jgraichen/deploy"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jgraichen/deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Fdeploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Fdeploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Fdeploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Fdeploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgraichen","download_url":"https://codeload.github.com/jgraichen/deploy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgraichen%2Fdeploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004065,"owners_count":26083668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2025-10-10T13:58:15.477Z","updated_at":"2025-10-10T13:58:23.841Z","avatar_url":"https://github.com/jgraichen.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deployment Container\n\nThis image provides deployment tools ready to be used in CI.\n\n## Example\n\n### 1. Create SSH key to connect to docker host\n\nCreate an SSH key pair on the target host and save the private key as a CI/CD file variable `SSH_PRIVATE_KEY_FILE`.\n\n```console\nroot@my-instance:~# ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_ed25519\n```\n\n### 2. Collect SSH hosts keys from docker host\n\nSSH needs to know the host key of the machines it connects to.\n\n#### SSH_KNOWN_HOST_FILE\n\nRun `ssh-keyscan \u003ctarget\u003e` to collect all SSH host keys:\n\n```console\nssh-keyscan \u003ctarget\u003e\n```\n\nAdd them to a CI/CD file variable `SSH_KNOWN_HOSTS_FILE`.\n\nThe variable can be updated independently of any Git commit. Therefore, even older commits can be deployed again when the server has changed.\n\n#### .ssh/known_hosts\n\nAlternatively, you can add them as a file to the repository:\n\n```console\nmkdir .ssh\nssh-keyscan \u003ctarget host\u003e \u003e .ssh/known_hosts\n```\n\n`setup-ssh` will use both sources if available.\n\n### 3. Set up deployment configuration\n\n```yaml\ndeploy production:\n  image: ghcr.io/jgraichen/deploy:1\n\n  # Optional: run deploy jobs only manual or add other rules\n  # when to deploy automatically.\n  when: manual\n\n  variables:\n    TARGET_HOST: root@\u003ctarget host\u003e\n    DOCKER_HOST: ssh://${TARGET_HOST}\n\n  before_script:\n    - eval \"$(ssh-agent -s)\"\n    - setup-ssh\n    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY\n\n  script:\n    # If needed, sync local configuration files to server\n    - rsync --mkpath --recursive --verbose \"config/\" \"${TARGET_HOST}/srv/compose/config/\"\n\n    # Deploy docker-compose to single host\n    - docker-compose up --detach\n\n    # Or a stack to swarm node or cluster\n    - docker stack deploy --compose-file docker-compose.yml\n\n  # Optional define a environment\n  environment:\n    name: production\n    url: https://example.org\n\n  # Ensure only one deployment job is run concurrently\n  resource_group: production\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgraichen%2Fdeploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgraichen%2Fdeploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgraichen%2Fdeploy/lists"}