Skip to content

Commit 48005e7

Browse files
committed
Add a new workflow to build and push
Update README.md
1 parent 93d6cd6 commit 48005e7

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Build and Publish
3+
4+
on:
5+
release:
6+
types:
7+
- published
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v3
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
- name: Login to Docker Hub
20+
uses: docker/login-action@v3
21+
with:
22+
username: ${{ secrets.DOCKER_USERNAME }}
23+
password: ${{ secrets.DOCKER_PASSWORD }}
24+
- name: Build and push Docker image
25+
uses: docker/build-push-action@v6
26+
with:
27+
context: .
28+
push: true
29+
platforms: linux/amd64,linux/arm64
30+
tags: ${{ secrets.DOCKER_USERNAME }}/github-runner-linux:${{ github.event.release.tag_name }},${{ secrets.DOCKER_USERNAME }}/github-runner-linux:latest

.github/workflows/test-runner.yml renamed to .github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Local runner test
1+
name: Test Runner
22

33
on:
44
push:

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22

33
Build a self-hosted GitHub action runner as an Ubuntu linux container
44

5-
### Build
6-
7-
```shell
8-
docker build -t runner .
9-
```
10-
11-
### Run
5+
## Development
126

137
Set latest `RUNNER_VERSION`
148

@@ -19,11 +13,19 @@ export RUNNER_VERSION=$(curl -sL \
1913
https://api.github.com/repos/actions/runner/releases/latest | jq .tag_name --raw-output)
2014
```
2115

16+
#### Build
17+
18+
```shell
19+
docker build --build-arg RUNNER_VERSION=$RUNNER_VERSION -t runner .
20+
```
21+
22+
#### Run
23+
2224
```shell
2325
docker compose up -d
2426
```
2527

26-
### Exec
28+
#### Exec
2729

2830
```shell
2931
docker exec -it container-name sh

0 commit comments

Comments
 (0)