Merge pull request #38 from solarwindscloud/NH-41925 #39
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 docker images | |
on: | |
push: | |
paths: | |
- 'test/run_tests/Dockerfile_*' | |
# Allows running this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }}/apm_ruby | |
DOCKERFILE: test/run_tests/Dockerfile | |
jobs: | |
build_push: | |
name: Build docker images | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu, debian, amzlinux, alpine] | |
steps: | |
- name: Checkout ${{ github.ref }} | |
uses: actions/checkout@v1 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker (both ARM and AMD64) | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}_${{ matrix.os }} # e.g. apm_ruby_ubuntu | |
flavor: | | |
latest=true | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64 #, linux/arm64 | |
file: test/run_tests/Dockerfile_${{ matrix.os }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |