Feature/Add workflow summaries #3
1 changed files with 52 additions and 20 deletions
|
|
@ -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,6 +27,19 @@ jobs:
|
|||
curl -f http://localhost:8080 || exit 1
|
||||
docker stop test-container
|
||||
|
||||
- name: Job Summary
|
||||
if: success()
|
||||
run: |
|
||||
SUMMARY_FILE="${GITHUB_STEP_SUMMARY:-${GITEA_STEP_SUMMARY:-/dev/stdout}}"
|
||||
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
|
||||
|
|
@ -48,16 +51,6 @@ jobs:
|
|||
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="${GITHUB_STEP_SUMMARY:-${GITEA_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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue