Skip to content

Commit

Permalink
构建测试工作流仅推送:minimal_test 和 lnmp_test
Browse files Browse the repository at this point in the history
  • Loading branch information
eyunzhu committed Nov 7, 2024
1 parent 3e30f0e commit 12a49d9
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/docker-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
# 构建 baota:minimal
- name: Build minimal image
run: |
docker build -t eyunzhu/baota:minimal -t eyunzhu/baota:latest -t eyunzhu/baota:minimal-${{ env.TAG }} -f ./dockerfiles/dockerfile.baota . || exit 1
docker build -t eyunzhu/baota:minimal -t eyunzhu/baota:minimal_test -f ./dockerfiles/dockerfile.baota . || exit 1
# 验证 baota:minimal 是否存在
- name: Verify images exist
Expand All @@ -47,27 +47,23 @@ jobs:
exit 1
fi
# 构建 baota:lnmp
# 构建 baota:lnmp_test
- name: Build lnmp image
run: |
docker build -t eyunzhu/baota:lnmp -t eyunzhu/baota:lnmp-${{ env.TAG }} -f ./dockerfiles/dockerfile.baota-lnmp . || exit 1
docker build -t eyunzhu/baota:lnmp_test -f ./dockerfiles/dockerfile.baota-lnmp . || exit 1
# 验证 baota:lnmp 是否存在
# 验证 baota:lnmp_test 是否存在
- name: Verify images exist
run: |
if ! docker image inspect eyunzhu/baota:lnmp > /dev/null 2>&1; then
echo "Error: eyunzhu/baota:lnmp does not exist!"
if ! docker image inspect eyunzhu/baota:lnmp_test > /dev/null 2>&1; then
echo "Error: eyunzhu/baota:lnmp_test does not exist!"
exit 1
fi
- name: Push minimal image to Docker Hub
run: |
docker push eyunzhu/baota:minimal
docker push eyunzhu/baota:latest
docker push eyunzhu/baota:minimal-${{ env.TAG }}
docker push eyunzhu/baota:minimal_test
- name: Push LNMP image to Docker Hub
run: |
docker push eyunzhu/baota:lnmp
docker push eyunzhu/baota:lnmp-${{ env.TAG }}
docker push eyunzhu/baota:lnmp_test

0 comments on commit 12a49d9

Please sign in to comment.