Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update - readme docs, license, cicd workflow steps #4

Merged
merged 5 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,21 +46,19 @@ 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: 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 }}

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
# 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/<your-org-or-repo> \
-e RUNNER_TOKEN=<your-runner-token> \
--name <container-name> \
chaddyc/gha-runner:latest
```

2. **Docker Compose**
```yaml
services:
github-runner:
image: chaddyc/gha-runner:latest
container_name: <container-name>
environment:
- GITHUB_URL=https://github.com/<your-org-or-repo>
- RUNNER_TOKEN=<your-runner-token>
restart: unless-stopped
```

3. **Docker Compose - Multi Containers**
```yaml
services:
github-runner:
image: chaddyc/gha-runner:latest
#container_name: <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/<your-org-or-repo>
- RUNNER_TOKEN=<your-runner-token>
restart: unless-stopped

## License

[MIT](LICENSE)


2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
github-runner:
image: github-runner
image: chaddyc/gha-runner:latest
container_name: <container-name>
environment:
- GITHUB_URL=https://github.com/<your-org-or-repo>
Expand Down