runner-images/.gitea/workflows/push.yaml
张泊明518370910136 3ba5cc87af
All checks were successful
push / build (push) Successful in 2m41s
ci: only use runs-on
2025-02-09 14:13:45 -05:00

46 lines
1.4 KiB
YAML

name: push
on:
push:
branches:
- master
jobs:
build:
runs-on: golang-ubuntu-latest
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.cn,direct
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519.pub
chmod 600 ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519.pub
ssh-keyscan -p 2222 focs.ji.sjtu.edu.cn >> ~/.ssh/known_hosts
ssh -T git@focs.ji.sjtu.edu.cn -p 2222
shell: bash
- 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
env:
TZ: Asia/Shanghai
run: ${{ env.build_command }}
- name: Test
run: make test
- name: Check images
run: docker images
- name: Remove dangling images
run: docker image prune -f
- name: Push
run: make push