From 4bf889737007f19f8364b695412e4e969d2cfb4d Mon Sep 17 00:00:00 2001 From: Juan Sebastian Montoya Date: Tue, 25 Nov 2025 18:32:17 -0500 Subject: [PATCH] Feature/Add workflow summaries (#3) Reviewed-on: https://git.jusemon.com/jusemon/threejs-test/pulls/3 Co-authored-by: Juan Sebastian Montoya Co-committed-by: Juan Sebastian Montoya --- .forgejo/workflows/ci.yaml | 74 +++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 21 deletions(-) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index 2689a1e..e87829b 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -16,16 +16,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Check Docker availability - run: | - set -e - docker --version - docker info - - - name: Setup Docker Buildx - run: | - docker buildx create --use || true - - name: Build Docker Image run: | docker build -t threejs-test:test . @@ -37,27 +27,30 @@ jobs: curl -f http://localhost:8080 || exit 1 docker stop test-container + - name: Job Summary + if: success() + run: | + SUMMARY_FILE="${FORGEJO_STEP_SUMMARY}" + cat >> "$SUMMARY_FILE" << 'EOF' + ## ✅ Build and Validation Complete + + - ✅ Docker image built successfully + - ✅ Image validated (container started and HTTP check passed) + + The image is ready for deployment. + EOF + publish: name: Publish to Registry runs-on: ubuntu needs: build-and-validate - if: github.event_name == 'push' || gitea.event_name == 'push' + if: github.event_name == 'push' steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all history for tags - - name: Check Docker availability - run: | - set -e - docker --version - docker info - - - name: Setup Docker Buildx - run: | - docker buildx create --use || true - - name: Login to Registry run: | echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.jusemon.com -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin @@ -153,9 +146,48 @@ jobs: # Check if tag already exists if git rev-parse "$TAG" >/dev/null 2>&1; then echo "Tag $TAG already exists, skipping tag creation" + echo "TAG_CREATED=false" >> $GITHUB_ENV else git tag -a "$TAG" -F /tmp/release_message.txt git push origin "$TAG" echo "Created tag $TAG with detailed release notes" + echo "TAG_CREATED=true" >> $GITHUB_ENV fi + - name: Job Summary + if: success() + run: | + SUMMARY_FILE="${FORGEJO_STEP_SUMMARY:-/dev/stdout}" + VERSION="${{ steps.version.outputs.version }}" + TAG="${{ steps.version.outputs.tag }}" + IMAGE_NAME="git.jusemon.com/jusemon/threejs-test:$VERSION" + TAG_STATUS="${TAG_CREATED:-false}" + + cat >> "$SUMMARY_FILE" << EOF + ## 🚀 Release Published + + **Version:** \`$VERSION\` + **Docker Image:** \`$IMAGE_NAME\` + **Git Tag:** \`$TAG\` + + ### Published Images + - ✅ \`$IMAGE_NAME\` + - ✅ \`git.jusemon.com/jusemon/threejs-test:latest\` + + ### Git Tag + EOF + + if [[ "$TAG_STATUS" == "true" ]]; then + echo "- ✅ Created and pushed \`$TAG\` with release notes" >> "$SUMMARY_FILE" + else + echo "- ⚠️ Tag \`$TAG\` already exists, skipped creation" >> "$SUMMARY_FILE" + fi + + cat >> "$SUMMARY_FILE" << 'EOF' + + ### Pull Command + ```bash + docker pull git.jusemon.com/jusemon/threejs-test:latest + ``` + EOF +