Skip to content

Docker Image Dragonfly DB #94

Docker Image Dragonfly DB

Docker Image Dragonfly DB #94

name: Docker Image Dragonfly DB
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *" # 6 AM Daily
push:
paths:
- .trigger
- dragonfly/**
- .github/workflows/*dragonfly*
jobs:
dragonfly:
name: Dragonfly DB
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "1.3"
- "1.4"
- "1.5"
- "1.6"
- "1.7"
- "1.8"
- "1.9"
- "1.10"
- "1.11"
- "1.12"
- "1.13"
- "1.14"
- "1.15"
- "1.16"
- "1.17"
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ !env.ACT }}
- name: Login to Docker Hub
uses: docker/login-action@v3
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')"
DRAGONFLY_VERSION=$(
docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls docker.dragonflydb.io/dragonflydb/dragonfly \
| egrep "^v${ESCAPED_VERSION}\.[0-9]+(\.[0-9]+)?\$" | sort -Vr | head -n1
)
echo "DRAGONFLY_VERSION=${DRAGONFLY_VERSION}" | tee /dev/stderr >> $GITHUB_ENV
- uses: docker/build-push-action@v6
with:
context: dragonfly
platforms: linux/amd64,linux/arm64
build-args: DRAGONFLY_VERSION=${{ env.DRAGONFLY_VERSION }}
push: ${{ github.ref == 'refs/heads/master' && !env.ACT }}
tags: ghcr.io/${{ github.repository_owner }}/dragonfly:${{ matrix.version }}
if: ${{ !env.ACT && github.ref == 'refs/heads/master'}}