This commit is contained in:
parent
49b453f110
commit
43401512fd
|
@ -1,45 +1,45 @@
|
||||||
---
|
---
|
||||||
name: push
|
name: push
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
container:
|
container:
|
||||||
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:golang-ubuntu-latest
|
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:golang-ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: https://gitea.com/BoYanZh/checkout@focs
|
uses: https://gitea.com/BoYanZh/checkout@focs
|
||||||
- name: Display Go version
|
- name: Display Go version
|
||||||
run: go version
|
run: go version
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
go env -w GO111MODULE=on
|
go env -w GO111MODULE=on
|
||||||
go env -w GOPROXY=https://goproxy.io,direct
|
go env -w GOPROXY=https://goproxy.io,direct
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519.pub
|
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519.pub
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519.pub
|
chmod 600 ~/.ssh/id_ed25519.pub
|
||||||
ssh-keyscan -p 2222 focs.ji.sjtu.edu.cn >> ~/.ssh/known_hosts
|
ssh-keyscan -p 2222 focs.ji.sjtu.edu.cn >> ~/.ssh/known_hosts
|
||||||
ssh -T git@focs.ji.sjtu.edu.cn -p 2222
|
ssh -T git@focs.ji.sjtu.edu.cn -p 2222
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Determine build command
|
- name: Determine build command
|
||||||
id: build_command
|
id: build_command
|
||||||
run: |
|
run: |
|
||||||
if echo "${{ github.event.head_commit.message }}" | grep -q "force build"; then
|
if echo "${{ github.event.head_commit.message }}" | grep -q "force build"; then
|
||||||
echo "build_command=make force-build" >> $GITHUB_ENV
|
echo "build_command=make force-build" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "build_command=make build" >> $GITHUB_ENV
|
echo "build_command=make build" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
run: ${{ env.build_command }}
|
run: ${{ env.build_command }}
|
||||||
- name: Check images
|
- name: Check images
|
||||||
run: docker images
|
run: docker images
|
||||||
- name: Remove dangling images
|
- name: Remove dangling images
|
||||||
run: docker image prune -f
|
run: docker image prune -f
|
||||||
- name: Push
|
- name: Push
|
||||||
run: make push
|
run: make push
|
||||||
|
|
Loading…
Reference in New Issue
Block a user