öoämj
CI / Load gitea-env.conf to pipeline env (push) Successful in 13s
ci-check Build version 0.1.0 required
ci-cucumber Cucumber tests
ci-bats Bats tests
ci-build Build complete
CI / Build & Push Artifact (push) Successful in 2m28s

This commit is contained in:
moilanik
2026-06-14 13:11:50 +03:00
parent 5848f47c0e
commit ccf833d698
+23 -9
View File
@@ -51,17 +51,25 @@ jobs:
TAG=$(echo "$TAGS_JSON" | jq -r 'if type == "array" then .[] | select(.commit.sha == "'"$GITHUB_SHA"'") | .name else empty end' | head -1)
if [ -n "$TAG" ]; then
echo "artifact_exists=true" >> "$GITHUB_OUTPUT"
echo "Commit already tagged as $TAG, skipping build"
echo "artifact_tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Build skipped: commit already tagged as $TAG"
else
echo "artifact_exists=false" >> "$GITHUB_OUTPUT"
echo "Build required: no tag for this commit"
fi
- name: Report check status
if: always()
run: |
VERSION="${{ needs.check.outputs.version }}"
VERSION="${{ steps.check.outputs.version }}"
ARTIFACT_EXISTS="${{ steps.check.outputs.artifact_exists }}"
ARTIFACT_TAG="${{ steps.check.outputs.artifact_tag }}"
if [ "${{ steps.check.outcome }}" = "success" ]; then
bash scripts/report-status.sh success "Check version $VERSION" ci-check
if [ "${ARTIFACT_EXISTS}" = "true" ]; then
bash scripts/report-status.sh success "Skip build: version $VERSION exists as $ARTIFACT_TAG" ci-check
else
bash scripts/report-status.sh success "Build version $VERSION required" ci-check
fi
else
bash scripts/report-status.sh failure "Check version $VERSION FAILED" ci-check
exit 1
@@ -79,6 +87,9 @@ jobs:
build:
needs: [check, quality-gate]
if: |
needs.check.outputs.artifact_exists == 'false' &&
needs.quality-gate.result == 'success'
runs-on: ubuntu-latest
services:
docker:
@@ -106,11 +117,12 @@ jobs:
- name: Report docker build status
if: always()
run: |
VERSION="${{ needs.check.outputs.version }}"
BUILD_EXIT="${{ steps.build.outputs.exit-code }}"
if [ "${BUILD_EXIT}" = "0" ]; then
bash scripts/report-status.sh success "Docker build OK" ci-docker-build
bash scripts/report-status.sh success "Docker build $VERSION OK" ci-docker-build
else
bash scripts/report-status.sh failure "Docker build FAILED" ci-docker-build
bash scripts/report-status.sh failure "Docker build $VERSION FAILED" ci-docker-build
fi
exit ${BUILD_EXIT}
@@ -164,11 +176,12 @@ jobs:
- name: Report docker push status
if: always()
run: |
VERSION="${{ needs.check.outputs.version }}"
PUSH_EXIT="${{ steps.push.outputs.exit-code }}"
if [ "${PUSH_EXIT}" = "0" ]; then
bash scripts/report-status.sh success "Docker push OK" ci-docker-push
bash scripts/report-status.sh success "Docker push $VERSION OK" ci-docker-push
else
bash scripts/report-status.sh failure "Docker push FAILED" ci-docker-push
bash scripts/report-status.sh failure "Docker push $VERSION FAILED" ci-docker-push
fi
exit ${PUSH_EXIT}
@@ -210,12 +223,13 @@ jobs:
- name: Report docker tag status
if: always()
run: |
VERSION="${{ needs.check.outputs.version }}"
TAG_STATUS="${{ steps.tag.outputs.status }}"
TAG_MESSAGE="${{ steps.tag.outputs.message }}"
if [ "${TAG_STATUS}" = "success" ]; then
bash scripts/report-status.sh success "${TAG_MESSAGE}" ci-docker-tag
bash scripts/report-status.sh success "Tag $VERSION OK" ci-docker-tag
else
TAG_EXIT="${{ steps.tag.outputs.exit-code }}"
bash scripts/report-status.sh failure "${TAG_MESSAGE}" ci-docker-tag
bash scripts/report-status.sh failure "Tag $VERSION FAILED" ci-docker-tag
exit ${TAG_EXIT}
fi