{"id":25314059,"url":"https://github.com/michaelakridge-noaa/docker-github-actions-runner","last_synced_at":"2025-04-07T14:28:45.682Z","repository":{"id":247686532,"uuid":"822863430","full_name":"MichaelAkridge-NOAA/docker-github-actions-runner","owner":"MichaelAkridge-NOAA","description":"Containerized Ephemeral Self-hosted GitHub Actions Runner via docker","archived":false,"fork":false,"pushed_at":"2024-08-12T21:18:35.000Z","size":146,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T16:54:25.467Z","etag":null,"topics":["docker","docker-compose","docker-image","github","github-actions","github-runner"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MichaelAkridge-NOAA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-07-02T01:34:42.000Z","updated_at":"2024-08-12T21:20:00.000Z","dependencies_parsed_at":"2024-07-10T04:33:40.697Z","dependency_job_id":null,"html_url":"https://github.com/MichaelAkridge-NOAA/docker-github-actions-runner","commit_stats":null,"previous_names":["michaelakridge-noaa/docker-github-actions-runner"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelAkridge-NOAA%2Fdocker-github-actions-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelAkridge-NOAA%2Fdocker-github-actions-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelAkridge-NOAA%2Fdocker-github-actions-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelAkridge-NOAA%2Fdocker-github-actions-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaelAkridge-NOAA","download_url":"https://codeload.github.com/MichaelAkridge-NOAA/docker-github-actions-runner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247668999,"owners_count":20976307,"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","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","docker-image","github","github-actions","github-runner"],"created_at":"2025-02-13T16:54:26.515Z","updated_at":"2025-04-07T14:28:45.650Z","avatar_url":"https://github.com/MichaelAkridge-NOAA.png","language":"Shell","readme":"# Docker GitHub Actions Self-Hosted Runner (ephemeral)\nContainerized GitHub Actions self-hosted runner via Docker. Ideal for:\n- Customization / Control / Flexibility\n- Performance / Support for Long-Running Jobs\n- Security and more.\n\n\u003cimg src=\"https://github.com/MichaelAkridge-NOAA/docker-github-actions-runner/raw/main/docs/images/00.png\" /\u003e\n\n# Features:\n- pulls latest offical github runner via github api(https://api.github.com/repos/actions/runner/releases/latest)\n- removes runner from repo after container stops. recreates on when retarted\n- ability to scale up multiple runners\n- runs in “ephemeral” mode which creates (and destroys) short-lived compute environment per job on demand\n\n## Read more about Github self-hosted runners\n- https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners\n\n# Setup\n## Step 0 | Setup Credentials \n### 0a Create a personal access token (https://github.com/settings/tokens)\n- go to your Github Profile : Settings / Developer Settings / Personal Access Token\n- Generate new token (with at least access permission scope for repo operations) \n\n### OR 0b Add a new self-hosted runner \n\u003cimg src=\"https://github.com/MichaelAkridge-NOAA/docker-github-actions-runner/raw/main/docs/images/01.png\" align=\"right\"  /\u003e\n\n- go to your Github repo\u003e Settings \u003e Actions \u003e Runners \u003e Click \"New self-hosted runner\"\n- look under the \"Configure\" section, and make a note of your github runner token\n\n## Step 1 | Pull Docker Image\n- Docker Hub Link: https://hub.docker.com/r/michaelakridge326/github-actions-sh-runner\n\n```\ndocker pull michaelakridge326/github-actions-sh-runner\n```\n## Step 2 | Setup using Docker Compose\n- Create \u0026 Update a docker-compose.yml file with your URL, Token, and a Name for the runner\n```\n# docker-compose.yml\nservices:\n  github-runner:\n    image: michaelakridge326/github-actions-sh-runner:v1.0.0\n    container_name: my-github-runner\n    environment:\n      - GH_REPO_URL=https://github.com/your_name/your_repo_here \n      - GH_RUNNER_NAME=my-docker-gh-runner-name-02\n    secrets:\n      - gh_pat\n    volumes:\n      - runner_work:/actions-runner/_work\n    restart: unless-stopped\n    networks:\n      - runner-network\nvolumes:\n  runner_work:\nsecrets:\n  gh_pat:\n    file: ./secrets/gh_pat.txt\nnetworks:\n  runner-network:\n    driver: bridge\n```\n#### Step 2 | Continued - Run Docker Compose File\n```\ndocker-compose up -d\n```\n## OR Step 2a | Run using the Docker Run CMD\n```\ndocker run -d \\\n  --name my-github-runner \\\n  -e GH_REPO_URL=https://github.com/your_repo_here \\\n  -e GH_PAT=insert_your_github_pat_here \\\n  -e GH_RUNNER_NAME=my-docker-gh-runner-name \\\n  -v runner_work:/actions-runner/_work \\\n  michaelakridge326/github-actions-sh-runner\n```\n# Spawn Multiple runners \n### Setup docker-compose like so\n```\n# docker-compose.yml\nversion: '3.8'\nservices:\n  github-runner:\n    image: michaelakridge326/github-actions-sh-runner:v1.0.0\n    environment:\n      - GH_REPO_URL=https://github.com/your_name/your_repo_here \n      - GH_RUNNER_NAME=my-docker-gh-runner-name-02\n    secrets:\n      - gh_pat\n    volumes:\n      - runner_work:/actions-runner/_work\n    restart: unless-stopped\n    networks:\n      - runner-network\nvolumes:\n  runner_work:\nsecrets:\n  gh_pat:\n    file: ./secrets/gh_pat.txt\nnetworks:\n  runner-network:\n    driver: bridge\n```\n### Then run (replace 4 with the number of runners you wish to start up)\n```\ndocker-compose up --scale github-runner=4 -d\n```\n# How to Use your New Self-hosted Runner with Github Workflows\n## Update the YAML in your github workflow file for each job like so:\n```\nruns-on: self-hosted\n```\n## View your Github Runners\n- Go back to your repo \u003e Settings \u003e Actions \u003e Runners  to see your self hosted Runner\n\n\u003cimg src=\"https://github.com/MichaelAkridge-NOAA/docker-github-actions-runner/raw/main/docs/images/03.png\"/\u003e\n\n----------\n#### Disclaimer\nThis repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project content is provided on an ‘as is’ basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.\n\n##### License\nSee the [LICENSE.md](./LICENSE.md) for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelakridge-noaa%2Fdocker-github-actions-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelakridge-noaa%2Fdocker-github-actions-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelakridge-noaa%2Fdocker-github-actions-runner/lists"}