Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Docker Image OpenSearch #488

Docker Image OpenSearch

Docker Image OpenSearch #488

name: Docker Image OpenSearch
on:
schedule:
- cron: "0 6 * * *" # 6 AM Daily
push:
paths:
- images/.trigger
- images/opensearch/**
- .github/workflows/*opensearch*
jobs:
opensearch:
name: OpenSearch
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "1.1"
- "1.2"
- "1.3"
- "2.0"
- "2.1"
- "2.2"
- "2.3"
- "2.4"
- "2.5"
- "2.6"
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ !env.ACT }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ !env.ACT }}
- name: Set build-args
run: |-
ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')"
OPENSEARCH_VERSION=$(
docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls docker.io/opensearchproject/opensearch \
| egrep "^${ESCAPED_VERSION}\.[0-9]+(\.[0-9]+)?\$" | sort -Vr | head -n1
)
echo "OPENSEARCH_VERSION=${OPENSEARCH_VERSION}" | tee /dev/stderr >> $GITHUB_ENV
- uses: docker/build-push-action@v3
with:
context: images/opensearch
platforms: linux/amd64,linux/arm64
build-args: OPENSEARCH_VERSION=${{ env.OPENSEARCH_VERSION }}
push: ${{ github.ref == 'refs/heads/main' && !env.ACT }}
tags: ghcr.io/${{ github.repository_owner }}/den-opensearch:${{ matrix.version }}