ci #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
#push: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
base_img: | |
- "adoptopenjdk/openjdk8:jdk8u422-b05-debian" | |
- "eclipse-temurin:8u422-b05-jdk-noble" | |
- "eclipse-temurin:21.0.4_7-jdk-noble" | |
vers: | |
- "5.0.0" | |
- "5.1.0" | |
- "5.1.1" | |
- "5.1.2" | |
- "5.1.3" | |
- "5.1.4" | |
- "5.2.0" | |
- "5.3.0" | |
- "5.3.1" | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Inspect builder | |
run: | | |
echo "Name: ${{ steps.buildx.outputs.name }}" | |
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" | |
echo "Status: ${{ steps.buildx.outputs.status }}" | |
echo "Flags: ${{ steps.buildx.outputs.flags }}" | |
echo "Platforms: ${{ steps.buildx.outputs.platforms }}" | |
- name: Build dockerfile (with no push) | |
run: | | |
latest=$(cat latest); | |
echo $latest; | |
latest_tag="--tag dyrnq/rocketmq:${{ matrix.vers }}"; | |
base_img="${{matrix.base_img}}" | |
if [[ "${base_img}" =~ "openjdk8" ]]; then | |
if [[ "${{ matrix.vers }}" = "${latest}" ]]; then | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:latest" | |
fi | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk8" | |
fi | |
if [[ "${base_img}" =~ "eclipse-temurin:8u422" ]]; then | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk8-noble" | |
fi | |
if [[ "${base_img}" =~ "eclipse-temurin:21" ]]; then | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk21-noble" | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk21" | |
fi | |
echo $latest_tag; | |
docker buildx build \ | |
--platform linux/amd64,linux/arm64/v8 \ | |
--output "type=image,push=false" \ | |
--file ./Dockerfile . \ | |
--build-arg version="${{ matrix.vers }}" \ | |
--build-arg BASE_IMAGE="${base_img}" \ | |
$latest_tag | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build dockerfile (with push) | |
run: | | |
latest=$(cat latest); | |
echo $latest; | |
latest_tag="--tag dyrnq/rocketmq:${{ matrix.vers }}"; | |
base_img="${{matrix.base_img}}" | |
if [[ "${base_img}" =~ "openjdk8" ]]; then | |
if [[ "${{ matrix.vers }}" = "${latest}" ]]; then | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:latest" | |
fi | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk8" | |
fi | |
if [[ "${base_img}" =~ "eclipse-temurin:8u422" ]]; then | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk8-noble" | |
fi | |
if [[ "${base_img}" =~ "eclipse-temurin:21" ]]; then | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk21-noble" | |
latest_tag="${latest_tag} --tag dyrnq/rocketmq:${{ matrix.vers }}-jdk21" | |
fi | |
echo $latest_tag; | |
docker buildx build \ | |
--platform linux/amd64,linux/arm64/v8 \ | |
--output "type=image,push=true" \ | |
--file ./Dockerfile . \ | |
--build-arg version="${{ matrix.vers }}" \ | |
--build-arg BASE_IMAGE="${base_img}" \ | |
$latest_tag | |