feat: build golang-ubuntu-latest image
All checks were successful
push / build (push) Successful in 51s
All checks were successful
push / build (push) Successful in 51s
This commit is contained in:
commit
e544dedd6e
29
.gitea/workflows/push.yaml
Normal file
29
.gitea/workflows/push.yaml
Normal 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
9
Dockerfile
Normal 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
12
Makefile
Normal 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
|
Loading…
Reference in New Issue
Block a user