Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: split into 2 jobs #220

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 42 additions & 14 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,51 @@ on:
- "main"

jobs:
image:
test:
# Only build linux/amd64 images for testing
env:
IMAGE_TEST: wildfly-test:latest
strategy:
matrix:
include:
- jdk-version: 11
dist: ubi9-minimal
platforms: linux/amd64
- jdk-version: 17
dist: ubi9-minimal
platforms: linux/amd64
- jdk-version: 21
dist: ubi9-minimal
platforms: linux/amd64
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4.2.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.6.1
- name: Build WildFly images
id: docker_build
uses: docker/build-push-action@v6.7.0
with:
load: true
tags: ${{ env.IMAGE_TEST }}
build-args: |
jdk=${{ matrix.jdk-version }}
dist=${{ matrix.dist }}
- name: Smoke Test
run: |
./scripts/smoke-test.sh ${{ env.IMAGE_TEST }}

# Push to the container registry only when a new tag is pushed
push:
needs: test
environment: quay.io
if: startsWith(github.event.ref, 'refs/tags/')
env:
# Put the "latest" tag on this JDK version
JDK_VERSION_FOR_LATEST: 21
IMAGE_TEST: wildfly-test:latest
strategy:
matrix:
include:
Expand All @@ -34,7 +74,6 @@ jobs:
- jdk-version: 21
dist: ubi9-minimal
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
environment: quay.io
runs-on: ubuntu-latest
steps:
- name: Check out the repo
Expand All @@ -56,15 +95,6 @@ jobs:
uses: docker/setup-qemu-action@v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.6.1
- name: Build WildFly images
id: docker_build
uses: docker/build-push-action@v6.7.0
with:
load: true
tags: ${{ env.IMAGE_TEST }}
- name: Smoke Test
run: |
./scripts/smoke-test.sh ${{ env.IMAGE_TEST }}
- name: Docker Login to Quay.io
if: startsWith(github.event.ref, 'refs/tags/')
uses: docker/login-action@v3.3.0
Expand All @@ -73,9 +103,7 @@ jobs:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Push WildFly images to container registry
# Only push to the container registry when a new tag is pushed to the repository
id: docker_push
if: startsWith(github.event.ref, 'refs/tags/')
uses: docker/build-push-action@v6.7.0
with:
push: true
Expand Down
Loading