Skip to content

Commit 524ccd7

Browse files
committed
feat: add multi-arch support, git tag versioning, and pipeline monitoring
- Add multi-platform builds (linux/amd64 + linux/arm64) - Add git tag support for versioned Docker images - Add automatic 'latest' tag on main branch pushes - Add dynamic tag generation for branches and tags - Add dual registry push (Docker Hub + GitHub Container Registry) - Add dive image analysis with continue-on-error - Add get-action-logs.ps1 for pipeline monitoring - Update README with comprehensive documentation - Fix Docker Hub repository name
1 parent b2d253c commit 524ccd7

4 files changed

Lines changed: 681 additions & 21 deletions

File tree

.dive-ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
rules:
2+
# If the efficiency is measured below X%, mark as failed.
3+
# Expressed as a ratio between 0-1.
4+
lowestEfficiency: 0.95
5+
6+
# If the amount of wasted space is at least X or larger than X, mark as failed.
7+
# Expressed in B, KB, MB, and GB.
8+
highestWastedBytes: 20MB
9+
10+
# If the amount of wasted space makes up for X% or more of the image, mark as failed.
11+
# Note: the base image layer is NOT included in the total image size.
12+
# Expressed as a ratio between 0-1; fails if the threshold is met or crossed.
13+
highestUserWastedPercent: 0.20

.github/workflows/build.yml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: build
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags:
8+
- '*'
49

510
jobs:
611
build:
@@ -51,27 +56,56 @@ jobs:
5156
# run: |
5257
# cd test && bash ./run_tests.sh "$IMAGE:$GIT_BRANCH"
5358

59+
- name: Run docker image analysis
60+
continue-on-error: true
61+
uses: MaxymVlasov/dive-action@v1.4.0
62+
with:
63+
image: ${{ steps.docker_build.outputs.imageid }}
64+
config-file: ${{ github.workspace }}/.dive-ci.yml
65+
github-token: ${{ secrets.GITHUB_TOKEN }}
66+
67+
- name: Generate tags
68+
id: tags
69+
run: |
70+
# Check if this is a tag push
71+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
72+
# Extract tag name (e.g., refs/tags/2.0.187 -> 2.0.187)
73+
VERSION_TAG="${{ github.ref_name }}"
74+
TAGS="${IMAGE}:${VERSION_TAG}"
75+
TAGS="${TAGS},ghcr.io/${GITHUB_REPOSITORY_OWNER}/${IMAGE}:${VERSION_TAG}"
76+
echo "Building from git tag: ${VERSION_TAG}"
77+
else
78+
# Branch push - use branch name
79+
TAGS="${IMAGE}:${GIT_BRANCH}"
80+
TAGS="${TAGS},ghcr.io/${GITHUB_REPOSITORY_OWNER}/${IMAGE}:${GIT_BRANCH}"
81+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
82+
TAGS="${TAGS},${IMAGE}:latest"
83+
TAGS="${TAGS},ghcr.io/${GITHUB_REPOSITORY_OWNER}/${IMAGE}:latest"
84+
fi
85+
echo "Building from branch: ${GIT_BRANCH}"
86+
fi
87+
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
88+
echo "Generated tags: ${TAGS}"
89+
5490
- name: Build and push
5591
uses: docker/build-push-action@v2
5692
with:
5793
context: .
58-
platforms: linux/amd64
94+
platforms: linux/amd64,linux/arm64
5995
push: true
60-
tags: |
61-
${{ env.IMAGE }}:${{ env.GIT_BRANCH }}
62-
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.GIT_BRANCH }}
96+
tags: ${{ steps.tags.outputs.tags }}
6397

6498
- name: Update Docker Hub Description
6599
uses: peter-evans/dockerhub-description@v2
66100
continue-on-error: true
67101
with:
68102
username: ${{ secrets.DOCKER_USERNAME }}
69103
password: ${{ secrets.DOCKER_PASSWORD }}
70-
repository: peterevans/dockerhub-description
104+
repository: aemdesign/java-ffmpeg
71105
- uses: meeDamian/github-release@1.0
72-
if: github.ref == 'refs/heads/master'
106+
if: startsWith(github.ref, 'refs/tags/')
73107
with:
74108
token: ${{ secrets.GITHUB_TOKEN }}
75-
tag: ${{ env.GITHUB_TAG }}
76-
name: ${{ env.GITHUB_TAG }}
109+
tag: ${{ github.ref_name }}
110+
name: ${{ github.ref_name }}
77111
body: ${{ env.GIT_RELEASE_NOTES }}

README.md

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Debian with Java 8 and FFMPEG
1+
## Java with FFMPEG
22

3-
[![build](https://github.com/aem-design/docker-java-ffmpeg/actions/workflows/build.yml/badge.svg?branch=jdk11)](https://github.com/aem-design/docker-java-ffmpeg/actions/workflows/build.yml)
3+
[![build](https://github.com/aem-design/docker-java-ffmpeg/actions/workflows/build.yml/badge.svg?branch=jdk17)](https://github.com/aem-design/docker-java-ffmpeg/actions/workflows/build.yml)
44
[![github license](https://img.shields.io/github/license/aem-design/java-ffmpeg)](https://github.com/aem-design/java-ffmpeg)
55
[![github issues](https://img.shields.io/github/issues/aem-design/java-ffmpeg)](https://github.com/aem-design/java-ffmpeg)
66
[![github last commit](https://img.shields.io/github/last-commit/aem-design/java-ffmpeg)](https://github.com/aem-design/java-ffmpeg)
@@ -9,23 +9,81 @@
99
[![docker pulls](https://img.shields.io/docker/pulls/aemdesign/java-ffmpeg)](https://hub.docker.com/r/aemdesign/java-ffmpeg)
1010
[![github release](https://img.shields.io/github/release/aem-design/java-ffmpeg)](https://github.com/aem-design/java-ffmpeg)
1111

12-
This is docker image based on [aemdesign/oracle-jdk](https://hub.docker.com/r/aemdesign/oracle-jdk/) with AEM base libs
12+
Docker image based on [aemdesign/oracle-jdk](https://hub.docker.com/r/aemdesign/oracle-jdk/) with FFMPEG and media processing libraries.
1313

14+
Multi-architecture support (amd64/arm64).
1415

15-
## Self Hosted runner
16+
## Docker Images
1617

17-
To build and deploy this repo you will need to add a self-hosted runner.
18+
Images are available on both registries:
19+
- **Docker Hub**: `aemdesign/java-ffmpeg`
20+
- **GitHub Container Registry**: `ghcr.io/aem-design/java-ffmpeg`
1821

22+
### Tags
23+
24+
- `latest` - Latest build from main branch
25+
- `jdk17` - JDK 17 branch
26+
- Version tags (pushed when git tags are created)
27+
28+
### Included Packages
29+
30+
* **imagemagick** - Image conversion and processing
31+
* **libx** - X11 libraries for forms processing
32+
* **ffmpeg** - Video and audio processing
33+
* **buildtools** - Build utilities for media libraries
34+
* **xvid** - Video codec library
35+
36+
## Development
37+
38+
### CI/CD Pipeline
39+
40+
The project uses GitHub Actions for continuous integration and deployment:
41+
42+
- **Multi-platform builds**: Images are built for both `linux/amd64` and `linux/arm64`
43+
- **Automated testing**: Java and FFMPEG versions are verified before pushing
44+
- **Image analysis**: Uses `dive` for Docker image layer analysis
45+
- **Dual registry push**: Automatically pushes to Docker Hub and GitHub Container Registry
46+
- **Git tag versioning**: Pushing a git tag automatically creates a corresponding Docker image tag
47+
48+
### Monitoring Pipeline Status
49+
50+
Use the `get-action-logs.ps1` PowerShell script to monitor GitHub Actions workflow status and logs.
51+
52+
#### Prerequisites
53+
54+
- GitHub CLI (`gh`) must be installed and authenticated
55+
- Install: `winget install --id GitHub.cli`
56+
- Authenticate: `gh auth login`
57+
58+
#### Quick Start
59+
60+
```powershell
61+
# Check current commit's pipeline status (saves logs to logs/ folder by default)
62+
.\get-action-logs.ps1
63+
64+
# Wait for pipeline to complete
65+
.\get-action-logs.ps1 -WaitForCompletion
66+
67+
# Show logs in console
68+
.\get-action-logs.ps1 -ShowLogs
69+
70+
# Force re-download logs
71+
.\get-action-logs.ps1 -Force
1972
```
20-
docker run -d --restart always --name github-runner-aemdesign -e RUNNER_NAME_PREFIX="ghraemd" -e ACCESS_TOKEN="<YOUR PERSONAL ACCESS TOKEN>" -e RUNNER_WORKDIR="/tmp/github-runner-aemdesign" -e RUNNER_GROUP="self-hosted" -e RUNNER_SCOPE="org" -e ORG_NAME="aem-design" -e LABELS="aemdesign,github-runner" -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/tmp/github-runner-your-repo myoung34/github-runner:latest
73+
74+
See full documentation: `Get-Help .\get-action-logs.ps1 -Full`
75+
76+
### Creating a New Release
77+
78+
```bash
79+
# Tag the commit
80+
git tag 1.0.0
81+
git push origin 1.0.0
2182
```
2283

23-
### Included Packages
84+
This will automatically build and push versioned Docker images to both registries.
2485

25-
Following is the list of packages included
86+
## License
2687

27-
* imagemagic - for converting assets
28-
* libx - for forms processing
29-
* buildtools - for building xvid
30-
* xvid - for building xvid
88+
See [LICENSE](LICENSE) file for details.
3189

0 commit comments

Comments
 (0)