From 821306e37bfff5e5e2f9282b74e19d156dc544a4 Mon Sep 17 00:00:00 2001 From: Chad Crouch Date: Sun, 1 Dec 2024 21:22:02 +0200 Subject: [PATCH 1/5] update - readme docs and license --- .github/workflows/docker-build.yml | 30 +++++++++++--- LICENSE | 21 ++++++++++ README.md | 65 +++++++++++++++++++++++++++++- docker-compose.yml | 2 +- 4 files changed, 110 insertions(+), 8 deletions(-) create mode 100644 LICENSE diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 5b32ca6..1467235 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -28,14 +28,14 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push ubuntu latest + - name: Build and push ubuntu 22.04 uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm64 - build-arg: UBUNTU_VERSION=latest + build-arg: UBUNTU_VERSION=22.04 push: true - tags: chaddyc/${{ github.event.repository.name }}:latest + tags: chaddyc/${{ github.event.repository.name }}:22.04 - name: Build and push ubuntu 24.04 uses: docker/build-push-action@v6 @@ -46,14 +46,32 @@ jobs: push: true tags: chaddyc/${{ github.event.repository.name }}:24.04 - - name: Build and push ubuntu 22.04 + - name: Build and push ubuntu latest uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm64 - build-arg: UBUNTU_VERSION=22.04 + build-arg: UBUNTU_VERSION=latest push: true - tags: chaddyc/${{ github.event.repository.name }}:22.04 + tags: chaddyc/${{ github.event.repository.name }}:latest + + # - name: Build and push ubuntu 24.04 + # uses: docker/build-push-action@v6 + # with: + # context: . + # platforms: linux/amd64,linux/arm64 + # build-arg: UBUNTU_VERSION=24.04 + # push: true + # tags: chaddyc/${{ github.event.repository.name }}:24.04 + + # - name: Build and push ubuntu 22.04 + # uses: docker/build-push-action@v6 + # with: + # context: . + # platforms: linux/amd64,linux/arm64 + # build-arg: UBUNTU_VERSION=22.04 + # push: true + # tags: chaddyc/${{ github.event.repository.name }}:22.04 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..af0ef2a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Chad Crouch + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index fcf87e1..16f89eb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,66 @@ -# gha-runner +# GitHub Actions Runner Docker + +This guide provides detailed instructions for setting up a self-hosted GitHub Actions Runner using Docker. You can choose to run the container with `docker run` or `docker-compose`. + +## Prerequisites + +Before starting, ensure you have the following: + +1. **Docker Installed** + Ensure Docker is installed and running on your system. You can follow the [official installation guide](https://docs.docker.com/get-docker/) for help. + +2. **Docker Compose (Optional)** + If using `docker-compose`, ensure it is installed. You can find installation instructions in the [official Docker Compose guide](https://docs.docker.com/compose/install/). + +3. **GitHub Runner Token** + - Go to your GitHub repository or organization. + - Navigate to **Settings > Actions > Runners**. + - Click **Add Runner** and copy the registration token provided. + +--- + +## Steps to Set Up the GitHub Actions Runner With Docker + +You can set up the runner using either `docker run` or `docker-compose`. Choose the method that suits your setup. + +1. **Docker Run** + ```bash + docker run -d \ + -e GITHUB_URL=https://github.com/ \ + -e RUNNER_TOKEN= \ + --name \ + chaddyc/gha-runner:latest + ``` + +2. **Docker Compose** + ```yaml + services: + github-runner: + image: chaddyc/gha-runner:latest + container_name: + environment: + - GITHUB_URL=https://github.com/ + - RUNNER_TOKEN= + restart: unless-stopped + ``` + +3. **Docker Compose - Multi Containers** + ```yaml + services: + github-runner: + image: chaddyc/gha-runner:latest + #container_name: + #don't use container name when deploying multi replica containers of your gha-runner + deploy: + mode: replicated + replicas: 2 + environment: + - GITHUB_URL=https://github.com/ + - RUNNER_TOKEN= + restart: unless-stopped + +## License + +[MIT](LICENSE) diff --git a/docker-compose.yml b/docker-compose.yml index 5d0bcfa..cbc4213 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: github-runner: - image: github-runner + image: chaddyc/gha-runner:latest container_name: environment: - GITHUB_URL=https://github.com/ From ef750276f2763ca4add7a9493a2431d801bb90b8 Mon Sep 17 00:00:00 2001 From: Chad Crouch Date: Sun, 1 Dec 2024 21:22:43 +0200 Subject: [PATCH 2/5] update - readme docs and license --- .github/workflows/docker-build.yml | 32 ++++++------------------------ 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 1467235..fac6477 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -55,30 +55,10 @@ jobs: push: true tags: chaddyc/${{ github.event.repository.name }}:latest - # - name: Build and push ubuntu 24.04 - # uses: docker/build-push-action@v6 - # with: - # context: . - # platforms: linux/amd64,linux/arm64 - # build-arg: UBUNTU_VERSION=24.04 - # push: true - # tags: chaddyc/${{ github.event.repository.name }}:24.04 - - # - name: Build and push ubuntu 22.04 - # uses: docker/build-push-action@v6 - # with: - # context: . - # platforms: linux/amd64,linux/arm64 - # build-arg: UBUNTU_VERSION=22.04 - # push: true - # tags: chaddyc/${{ github.event.repository.name }}:22.04 - - - - # - name: Update docker readme description - # uses: peter-evans/dockerhub-description@v3 - # with: - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_PASSWORD }} - # repository: chaddyc/${{ github.event.repository.name }} + - name: Update docker readme description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: chaddyc/${{ github.event.repository.name }} \ No newline at end of file From 87dc7a21ffc2bb7b1267ca7e69571b2399fffb28 Mon Sep 17 00:00:00 2001 From: Chad Crouch Date: Sun, 1 Dec 2024 21:23:13 +0200 Subject: [PATCH 3/5] update - readme docs and license --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 16f89eb..6e2a396 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,6 @@ Before starting, ensure you have the following: - Navigate to **Settings > Actions > Runners**. - Click **Add Runner** and copy the registration token provided. ---- - ## Steps to Set Up the GitHub Actions Runner With Docker You can set up the runner using either `docker run` or `docker-compose`. Choose the method that suits your setup. From 73734482a3c92280223fb70b0b1e6f4586d98202 Mon Sep 17 00:00:00 2001 From: Chad Crouch Date: Sun, 1 Dec 2024 21:24:48 +0200 Subject: [PATCH 4/5] update - readme docs and license --- .github/pull_request_template.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9db0ab2..e6dc3cc 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,5 @@ ## Description + Provide a brief summary of the changes in this PR, including the problem being solved or the feature being added. ## Changes From 955718857a306bfb49216afc11a4a61925df64a5 Mon Sep 17 00:00:00 2001 From: Chad Crouch Date: Sun, 1 Dec 2024 21:30:04 +0200 Subject: [PATCH 5/5] update - readme docs and license --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index e80735b..9ea08d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ ARG UBUNTU_VERSION=20.04 FROM ubuntu:${UBUNTU_VERSION} +LABEL org.opencontainers.image.authors="https://github.com/chaddyc" ENV DEBIAN_FRONTEND=noninteractive