- add platforms to buildx setup #991
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: ${{ matrix.PLATFORM }} | |
strategy: | |
fail-fast: false | |
matrix: | |
DISTRO: [tomcat] | |
PLATFORM: [ubuntu-22.04, aws-arm-core-2-default] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
if: ${{ matrix.PLATFORM == 'aws-arm-core-2-default' }} | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Build | |
run: ./pipeline.sh | |
env: | |
DISTRO: ${{ matrix.DISTRO }} | |
EE: false | |
NEXUS_PASS: ${{ secrets.NEXUS_PASS }} | |
NEXUS_USER: ${{ secrets.NEXUS_USER }} | |
- name: Test | |
run: ./test.sh | |
working-directory: test | |
env: | |
DISTRO: ${{ matrix.DISTRO }} | |
EE: false | |
publish: | |
runs-on: aws-arm-core-2-default | |
needs: build-and-test | |
#if: ${{ github.ref == 'refs/heads/next' || startsWith(github.ref, 'refs/heads/7.') }} | |
strategy: | |
matrix: | |
DISTRO: [tomcat] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: linux/arm64,linux/amd64 | |
- name: Expose GitHub Runtime | |
uses: actions/github-script@v6 | |
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 }} |