Skip to content

Docker Image CI

Docker Image CI #1147

Workflow file for this run

name: Docker Image CI
on:
push:
branches:
- master
schedule:
- cron: 0 1 * * *
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
major: [ 7,8 ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set variables
id: vars
working-directory: ${{ matrix.major }}
run: |
echo "repository=${GITHUB_ACTOR}/$(basename ${GITHUB_REPOSITORY})" >> $GITHUB_OUTPUT
echo "version=$(grep -oE 'ES_VERSION=[[:space:]]*[0-9].[0-9]+.[0-9]+' Dockerfile | grep -oE '[0-9].[0-9]+.[0-9]+')" >> $GITHUB_OUTPUT
echo "minor_version=$(grep -oE 'ES_VERSION=[[:space:]]*[0-9].[0-9]+.[0-9]+' Dockerfile | grep -oE '[0-9].[0-9]+')" >> $GITHUB_OUTPUT
echo "workdir=${{ matrix.major }}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ steps.vars.outputs.workdir }}
pull: true
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ steps.vars.outputs.repository }}:${{ matrix.major }}
${{ steps.vars.outputs.repository }}:${{ steps.vars.outputs.minor_version }}
${{ steps.vars.outputs.repository }}:${{ steps.vars.outputs.version }}