Merge branch '6.x' into 6.x-dev #150
Workflow file for this run
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: Docker Build | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
jobs: | |
build-docker-images: | |
strategy: | |
matrix: | |
image-variant: [prd,dev] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fill GitHub Environment Variables | |
uses: FranzDiebold/github-env-vars-action@v2 | |
- name: Fill PHP Version Environment Variable | |
uses: c-py/action-dotenv-to-setenv@v5 | |
with: | |
env-file: .build.env | |
- name: Prepare Workflow Environment | |
id: prep | |
run: | | |
echo "docker-image-name=${DOCKER_IMAGE_NAME}" >> $GITHUB_OUTPUT | |
echo "build-date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | |
- name: Fill "${{ steps.prep.outputs.docker-image-name }}" Docker Image metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
images: "${{ steps.prep.outputs.docker-image-name }}" | |
tags: | | |
type=raw,value=rc-${{ matrix.image-variant }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Create Dockerfile | |
run: | | |
make Dockerfile | |
- name: Build "${{ steps.prep.outputs.docker-image-name }}" Docker Image | |
id: build | |
uses: docker/build-push-action@v6 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: Dockerfile | |
target: ${{ matrix.image-variant }} | |
build-args: | | |
VERSION_ARG=${{ env.ELASTICMS_WEB_VERSION }} | |
RELEASE_ARG=${{ env.CI_RUN_ID }} | |
VCS_REF_ARG=${{ env.CI_SHA }} | |
BUILD_DATE_ARG=${{ steps.prep.outputs.build-date }} | |
push: false | |
load: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
outputs: type=docker,dest=/tmp/image.tar | |
- name: Load Docker Image | |
run: | | |
docker load --input /tmp/image.tar | |
- name: Check Docker Image | |
run: | | |
docker image inspect ${{ steps.prep.outputs.docker-image-name }}:rc-${{ matrix.image-variant }} | |
docker history ${{ steps.prep.outputs.docker-image-name }}:rc-${{ matrix.image-variant }} |