runner-images/.gitea/workflows/push.yaml
张泊明518370910136 cb0f52adb9
All checks were successful
push / build (push) Successful in 37s
ci: use golang-ubuntu-latest runner image
2024-10-12 06:47:54 -04:00

39 lines
1.3 KiB
YAML

---
name: push
on:
push:
branches:
- master
jobs:
build:
container:
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:golang-ubuntu-latest
volumes:
- /home/actions/.ssh:/root/.ssh
steps:
- name: Check out repository code
uses: https://gitea.com/BoYanZh/checkout@focs
- 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: 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