Skip to content

Commit

Permalink
feat(traefik): build both v2 and v3
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Nov 11, 2024
1 parent 1b315d0 commit 82da7ef
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:

jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
name: Build Treafik ${{ matrix.traefik.suffix }} with OpenSSL
runs-on: ubuntu-latest
permissions:
packages: write
Expand All @@ -33,21 +33,30 @@ jobs:
security-events: write
id-token: write
attestations: write
strategy:
fail-fast: false
matrix:
traefik:
- suffix: "v2"
primaryTag: "latest"
- suffix: "v3"
primaryTag: "v3"
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Get image version
id: getversion
run: echo "version=$(head -n 1 traefik/Dockerfile | sed -r -e 's/^([^:]+):([^ @$-]+).*/\2/')" >> "${GITHUB_OUTPUT}"
run: echo "version=$(head -n 1 "traefik/Dockerfile.${{ matrix.traefik.suffix }}" | sed -r -e 's/^([^:]+):([^ @$-]+).*/\2/')" >> "${GITHUB_OUTPUT}"

- name: Build and push image
uses: ./.github/actions/build-docker-image
with:
context: traefik
file: traefik/Dockerfile.${{ matrix.traefik.suffix }}
push: ${{ github.base_ref == null }}
cache-from: type=gha,scope=traefik
cache-to: type=gha,mode=max,scope=traefik
cache-from: type=gha,scope=traefik-${{ matrix.traefik.suffix }}
cache-to: type=gha,mode=max,scope=traefik-${{ matrix.traefik.suffix }}
no-cache: ${{ github.event_name == 'workflow_dispatch' }}
primaryTag: ghcr.io/automattic/vip-container-images/traefik_openssl:${{ steps.getversion.outputs.version }}
tags: ghcr.io/automattic/vip-container-images/traefik_openssl:latest
primaryTag: ghcr.io/automattic/vip-container-images/traefik_openssl:${{ matrix.traefik.primaryTag }}
tags: ghcr.io/automattic/vip-container-images/traefik_openssl:${{ steps.getversion.outputs.version }}
3 changes: 0 additions & 3 deletions traefik/Dockerfile

This file was deleted.

3 changes: 3 additions & 0 deletions traefik/Dockerfile.v2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM traefik:2.11.13@sha256:c9769cb5646ff62101899859932183f0da4e9da3ee2be8beebd0ea781584fa23

RUN apk upgrade --no-cache && apk add --no-cache openssl
3 changes: 3 additions & 0 deletions traefik/Dockerfile.v3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM traefik:v3.2.0@sha256:66e37237b371f2b25ce5f247cc371976929dcb18c041e05685f1de1df6422b72

RUN apk upgrade --no-cache && apk add --no-cache openssl

0 comments on commit 82da7ef

Please sign in to comment.