Skip to content

Commit fa03ba1

Browse files
committed
feat: inital commit
0 parents  commit fa03ba1

3 files changed

Lines changed: 115 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
schedule:
10+
- cron: '0 0 * * 0' # Weekly on Sunday at midnight UTC
11+
workflow_dispatch:
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Log in to Container Registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Generate build date
42+
id: date
43+
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
44+
45+
- name: Extract metadata for Docker
46+
id: meta
47+
uses: docker/metadata-action@v5
48+
with:
49+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
50+
tags: |
51+
type=raw,value=latest,enable={{is_default_branch}}
52+
type=semver,pattern={{version}}+${{ steps.date.outputs.date }}
53+
type=semver,pattern={{version}}
54+
type=semver,pattern={{major}}.{{minor}}
55+
type=semver,pattern={{major}}
56+
57+
- name: Build and push Docker image
58+
uses: docker/build-push-action@v5
59+
with:
60+
context: .
61+
platforms: linux/amd64,linux/arm64
62+
push: true
63+
tags: ${{ steps.meta.outputs.tags }}
64+
labels: ${{ steps.meta.outputs.labels }}
65+
cache-from: type=gha
66+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM myoung34/github-runner:ubuntu-jammy
2+
3+
RUN apt-get update && \
4+
apt-get install -y --no-install-recommends npm && \
5+
apt-get clean && \
6+
rm -rf /var/lib/apt/lists/*

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# GitHub Runner
2+
3+
Custom GitHub Actions self-hosted runner image based on [myoung34/github-runner](https://github.com/myoung34/docker-github-actions-runner) with npm pre-installed.
4+
5+
## Image
6+
7+
```
8+
ghcr.io/akash-network/github-runner
9+
```
10+
11+
### Available Tags
12+
13+
| Tag | Description |
14+
|-----|-------------|
15+
| `latest` | Latest build from main branch |
16+
| `v1.0.0+YYYYMMDD` | Versioned release with build date |
17+
| `v1.0.0` | Versioned release |
18+
| `v1.0` | Minor version |
19+
| `v1` | Major version |
20+
21+
## Included Tools
22+
23+
- All tools from the base `myoung34/github-runner:ubuntu-jammy` image
24+
- npm
25+
26+
## Releases
27+
28+
To create a new versioned release:
29+
30+
```bash
31+
git tag v1.0.0
32+
git push origin v1.0.0
33+
```
34+
35+
This triggers the build workflow which publishes:
36+
- `v1.0.0+YYYYMMDD` (with build date metadata)
37+
- `v1.0.0`
38+
- `v1.0`
39+
- `v1`
40+
41+
## Automatic Updates
42+
43+
The image is automatically rebuilt weekly (Sundays at midnight UTC) to incorporate upstream updates and security patches.

0 commit comments

Comments
 (0)