Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(traefik): build both v2 and v3 #955

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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