Build, test, and publish CE #1254
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: Build, test, and publish CE | |
on: [pull_request, push, workflow_dispatch] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
DISTRO: [tomcat, wildfly, run] | |
PLATFORM: [amd64, arm64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
if: ${{ matrix.PLATFORM != 'amd64' }} | |
with: | |
platforms: ${{ matrix.PLATFORM }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Expose GitHub Runtime | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
Object.keys(process.env).forEach(function (key) { | |
if (key.startsWith('ACTIONS_')) { | |
core.info(`${key}=${process.env[key]}`); | |
core.exportVariable(key, process.env[key]); | |
} | |
}); | |
- name: Build | |
run: ./pipeline.sh | |
env: | |
DISTRO: ${{ matrix.DISTRO }} | |
EE: false | |
PLATFORM: ${{ matrix.PLATFORM }} | |
NEXUS_PASS: ${{ secrets.NEXUS_PASS }} | |
NEXUS_USER: ${{ secrets.NEXUS_USER }} | |
- name: Test | |
run: ./test.sh | |
working-directory: test | |
env: | |
DISTRO: ${{ matrix.DISTRO }} | |
EE: false | |
PLATFORM: ${{ matrix.PLATFORM }} | |
publish: | |
runs-on: ubuntu-20.04 | |
needs: build-and-test | |
if: ${{ github.ref == 'refs/heads/next' || startsWith(github.ref, 'refs/heads/7.') }} | |
strategy: | |
matrix: | |
DISTRO: [tomcat, wildfly, run] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64,amd64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Expose GitHub Runtime | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
Object.keys(process.env).forEach(function (key) { | |
if (key.startsWith('ACTIONS_')) { | |
core.info(`${key}=${process.env[key]}`); | |
core.exportVariable(key, process.env[key]); | |
} | |
}); | |
- name: Publish multi-platform images | |
run: ./release.sh | |
env: | |
DISTRO: ${{ matrix.DISTRO }} | |
EE: false | |
PLATFORMS: linux/arm64,linux/amd64 | |
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | |
NEXUS_PASS: ${{ secrets.NEXUS_PASS }} | |
NEXUS_USER: ${{ secrets.NEXUS_USER }} |