Feature/Add workflow summaries #3
1 changed files with 53 additions and 21 deletions
|
|
@ -16,16 +16,6 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Build Docker Image
|
||||||
run: |
|
run: |
|
||||||
docker build -t threejs-test:test .
|
docker build -t threejs-test:test .
|
||||||
|
|
@ -37,27 +27,30 @@ jobs:
|
||||||
curl -f http://localhost:8080 || exit 1
|
curl -f http://localhost:8080 || exit 1
|
||||||
docker stop test-container
|
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:
|
publish:
|
||||||
name: Publish to Registry
|
name: Publish to Registry
|
||||||
runs-on: ubuntu
|
runs-on: ubuntu
|
||||||
needs: build-and-validate
|
needs: build-and-validate
|
||||||
if: github.event_name == 'push' || gitea.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Fetch all history for tags
|
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
|
- name: Login to Registry
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.jusemon.com -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
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
|
# Check if tag already exists
|
||||||
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
||||||
echo "Tag $TAG already exists, skipping tag creation"
|
echo "Tag $TAG already exists, skipping tag creation"
|
||||||
|
echo "TAG_CREATED=false" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
git tag -a "$TAG" -F /tmp/release_message.txt
|
git tag -a "$TAG" -F /tmp/release_message.txt
|
||||||
git push origin "$TAG"
|
git push origin "$TAG"
|
||||||
echo "Created tag $TAG with detailed release notes"
|
echo "Created tag $TAG with detailed release notes"
|
||||||
|
echo "TAG_CREATED=true" >> $GITHUB_ENV
|
||||||
fi
|
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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue