fix: gitea ci/cd文件添加构建结果通知
Continuous integration / Build (push) Failing after 1m48s Details
Continuous integration / Check Build Status (push) Has been skipped Details

This commit is contained in:
chenwj 2024-09-04 16:56:06 +08:00
parent 31fdf65487
commit 66d8ca6294
2 changed files with 20 additions and 3 deletions

2
.env
View File

@ -1,2 +1,2 @@
DATABASE_URL=mysql://root:Chenweijia113!@localhost/lottery
version = "1.0.1"
version = "1.0.2"

View File

@ -54,6 +54,23 @@ jobs:
docker push hub.airpig.cn/library/$REPO:$new_version
docker rmi hub.airpig.cn/library/$REPO:$new_version
- name: Check job status
check-status:
needs: build
name: Check Build Status
runs-on: ubuntu-latest
steps:
- name: Check if build job succeeded
if: needs.build.result == 'success'
run: |
echo "This job's status is ${{ job.status }}."
version=$(grep -E '^version' $VERSION_FILE | awk -F'"' '{print $2}')
new_version="v${version}"
msg="Build job: $REPO, version: $new_version succeeded!!!"
curl https://ding.airpig.cn/QfagvFa7u323xUS5yRbFR3/$msg
- name: Check if build job failed
if: needs.build.result == 'failure'
run: |
version=$(grep -E '^version' $VERSION_FILE | awk -F'"' '{print $2}')
new_version="v${version}"
msg="Build job: $REPO, version:$new_version failed!!! "
curl https://ding.airpig.cn/QfagvFa7u323xUS5yRbFR3/$msg