feat: build golang-ubuntu-latest image
All checks were successful
push / build (push) Successful in 51s

This commit is contained in:
张泊明518370910136 2024-10-10 23:59:10 -04:00
commit e544dedd6e
GPG Key ID: CA088E6D9284F870
4 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,29 @@
---
name: push
on:
push:
branches:
- golang-ubuntu-latest
jobs:
build:
container:
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
steps:
- name: Check out repository code
uses: https://gitea.com/BoYanZh/checkout@focs
- name: Determine build command
id: build_command
run: |
if echo "${{ github.event.head_commit.message }}" | grep -q "force build"; then
echo "build_command=make force-build" >> $GITHUB_ENV
else
echo "build_command=make build" >> $GITHUB_ENV
fi
- name: Build
run: ${{ env.build_command }}
- name: Check images
run: docker images
- name: Remove dangling images
run: docker image prune -f
- name: Push
run: make push

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
ARG GO_VERSION=1.23.1
ENV PATH=$PATH:/usr/local/go/bin:/root/go/bin
RUN wget -q https://studygolang.com/dl/golang/go${GO_VERSION}.linux-amd64.tar.gz && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && \
rm go${GO_VERSION}.linux-amd64.tar.gz

12
Makefile Normal file
View File

@ -0,0 +1,12 @@
.PHONY: all force-build build push
all: build
force-build:
docker build --no-cache -t focs.ji.sjtu.edu.cn:5000/gitea/runner-images:golang-ubuntu-latest .
build:
docker build -t focs.ji.sjtu.edu.cn:5000/gitea/runner-images:golang-ubuntu-latest .
push:
docker push focs.ji.sjtu.edu.cn:5000/gitea/runner-images:golang-ubuntu-latest

1
README.md Normal file
View File

@ -0,0 +1 @@
# Runner Images with Golang