From fc0358eefdc5b2d113f53f761f4a39c896189615 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Thu, 26 Sep 2024 14:04:01 +0800 Subject: [PATCH] ci: build & push (#3) Reviewed-on: https://focs.ji.sjtu.edu.cn/git/FOCS-dev/runner-images/pulls/3 Co-authored-by: Boming Zhang Co-committed-by: Boming Zhang --- .gitea/workflows/push.yaml | 35 +++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- .gitmodules | 3 +++ Dockerfile | 2 -- JOJ3 | 1 + Makefile | 3 +++ 6 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 .gitea/workflows/push.yaml create mode 100644 .gitmodules create mode 160000 JOJ3 diff --git a/.gitea/workflows/push.yaml b/.gitea/workflows/push.yaml new file mode 100644 index 0000000..006680e --- /dev/null +++ b/.gitea/workflows/push.yaml @@ -0,0 +1,35 @@ +--- +name: push +on: + push: + branches: + - master +jobs: + build: + container: + image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest + volumes: + - /home/actions/.ssh:/root/.ssh + steps: + - name: Check out repository code + uses: https://gitea.com/BoYanZh/checkout@focs + - name: Setup Go 1.23.1 + run: | + wget -q https://studygolang.com/dl/golang/go1.23.1.linux-amd64.tar.gz + rm -rf /usr/local/go + tar -C /usr/local -xzf go1.23.1.linux-amd64.tar.gz + rm -rf go1.23.1.linux-amd64.tar.gz + echo "PATH=$PATH:/usr/local/go/bin:/root/go/bin" >> $GITHUB_ENV + - name: Display Go version + run: go version + - name: Prepare + run: | + go env -w GO111MODULE=on + go env -w GOPROXY=https://goproxy.io,direct + chown -R root:root /root/.ssh + - name: Build + run: make build + - name: Check images + run: docker ps -a + - name: Push + run: make push diff --git a/.gitignore b/.gitignore index 70a2b82..572fc75 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/bin/joj3 +/bin/* +!/bin/joj3-teapot diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ffcd5ea --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "JOJ3"] + path = JOJ3 + url = ssh://git@focs.ji.sjtu.edu.cn:2222/FOCS-dev/JOJ3.git diff --git a/Dockerfile b/Dockerfile index 625bda1..715a280 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,3 @@ -# syntax=docker/dockerfile:1 - FROM focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest-slim RUN apt-get update && \ diff --git a/JOJ3 b/JOJ3 new file mode 160000 index 0000000..1bb0ddd --- /dev/null +++ b/JOJ3 @@ -0,0 +1 @@ +Subproject commit 1bb0ddd253092895405d02e66ff089743735c941 diff --git a/Makefile b/Makefile index 94e0769..31e3ea5 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ all: build build: + git submodule update --init --remote + $(MAKE) -C JOJ3 + cp JOJ3/build/* bin/ docker build -t focs.ji.sjtu.edu.cn:5000/gitea/runner-images:focs-ubuntu-latest-slim . push: