Skip to content

Docker Image Varnish #532

Docker Image Varnish

Docker Image Varnish #532

Workflow file for this run

name: Docker Image Varnish
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *" # 6 AM Daily
push:
paths:
- varnish/**
- .github/workflows/varnish.yml
jobs:
varnish:
name: Varnish
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "6.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "7.5"
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: Determine Version
run: |-
ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')"
VARNISH_VERSION=$(
docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls varnish \
| egrep "^${ESCAPED_VERSION}(\.[0-9]+)?(\.[0-9]+)?(-alpine)?\$" | sort -Vr | head -n1
)
echo "VARNISH_VERSION=${VARNISH_VERSION}" | tee /dev/stderr >> $GITHUB_ENV
- uses: docker/build-push-action@v3
with:
context: varnish
platforms: linux/amd64,linux/arm64
build-args: VARNISH_VERSION=${{ env.VARNISH_VERSION }}
push: ${{ github.ref == 'refs/heads/main' && !env.ACT }}
tags: ghcr.io/${{ github.repository_owner }}/varnish:${{ matrix.version }},wardenenv/varnish:${{matrix.version}}
varnish-lts:
name: Varnish LTS
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "6.0"
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: Determine Version
run: |-
ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')"
VARNISH_VERSION=$(
docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls varnish \
| egrep "^${ESCAPED_VERSION}(\.[0-9]+)?(\.[0-9]+)?(-alpine)?\$" | sort -Vr | head -n1
)
echo "VARNISH_VERSION=${VARNISH_VERSION}" | tee /dev/stderr >> $GITHUB_ENV
- uses: docker/build-push-action@v3
with:
context: varnish
file: varnish/Dockerfile.lts
platforms: linux/amd64,linux/arm64
build-args: VARNISH_VERSION=${{ env.VARNISH_VERSION }}
push: ${{ github.ref == 'refs/heads/main' && !env.ACT }}
tags: ghcr.io/${{ github.repository_owner }}/varnish:${{ matrix.version }},wardenenv/varnish:${{matrix.version}}
varnish-legacy:
name: Varnish Legacy
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "6.5"
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: Configure RPM repository
run: echo "VARNISH_VERSION=$(echo ${{ matrix.version }} | tr -d .)" >> $GITHUB_ENV
- uses: docker/build-push-action@v3
with:
context: varnish
file: varnish/Dockerfile.legacy
platforms: linux/amd64, linux/arm64
build-args: VARNISH_VERSION=${{ env.VARNISH_VERSION }}
push: ${{ github.ref == 'refs/heads/main' && !env.ACT }}
tags: ghcr.io/${{ github.repository_owner }}/varnish:${{ matrix.version }},wardenenv/varnish:${{matrix.version}}