2023-04-30 15:51:46 +02:00
|
|
|
name: Build and publish Docker images
|
2021-04-01 12:14:32 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2021-04-07 17:10:37 +02:00
|
|
|
schedule:
|
2022-12-03 14:30:40 +01:00
|
|
|
- cron: "0 0 * * 1"
|
2021-04-01 12:14:32 +02:00
|
|
|
push:
|
|
|
|
branches:
|
2021-04-05 13:13:20 +02:00
|
|
|
- main
|
2021-04-01 12:14:32 +02:00
|
|
|
tags:
|
2022-12-03 14:30:40 +01:00
|
|
|
- "*.*.*"
|
2021-04-01 12:14:32 +02:00
|
|
|
paths-ignore:
|
2022-12-03 14:30:40 +01:00
|
|
|
- "test/*"
|
|
|
|
- ".gitignore"
|
|
|
|
- "docker-compose-separate-containers.yml"
|
|
|
|
- "docker-compose.yml"
|
|
|
|
- "LICENSE"
|
|
|
|
- "Makefile"
|
|
|
|
- "*.md"
|
2021-04-01 12:14:32 +02:00
|
|
|
|
|
|
|
jobs:
|
2021-04-06 00:11:53 +02:00
|
|
|
multiarch-build-debian:
|
2023-04-30 15:51:46 +02:00
|
|
|
name: Build and publish Debian image
|
2021-04-01 12:14:32 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-03 19:36:31 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-04-01 12:14:32 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-12-03 14:30:40 +01:00
|
|
|
|
2023-05-02 05:21:41 +02:00
|
|
|
- name: Retrieve nginx-proxy version
|
|
|
|
id: nginx-proxy_version
|
|
|
|
run: echo "VERSION=$(git describe --tags)" >> "$GITHUB_OUTPUT"
|
2021-04-06 00:11:53 +02:00
|
|
|
|
2021-04-01 12:14:32 +02:00
|
|
|
- name: Get Docker tags for Debian based image
|
|
|
|
id: docker_meta_debian
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/metadata-action@v4
|
2021-04-01 12:14:32 +02:00
|
|
|
with:
|
2021-04-02 00:39:41 +02:00
|
|
|
images: |
|
2022-03-04 10:59:50 +01:00
|
|
|
ghcr.io/nginx-proxy/nginx-proxy
|
2021-04-02 00:39:41 +02:00
|
|
|
nginxproxy/nginx-proxy
|
|
|
|
jwilder/nginx-proxy
|
|
|
|
tags: |
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
2022-12-03 14:34:15 +01:00
|
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
2022-01-14 14:29:03 +01:00
|
|
|
labels: |
|
2022-01-14 14:39:33 +01:00
|
|
|
org.opencontainers.image.authors=Nicolas Duchon <nicolas.duchon@gmail.com> (@buchdag), Jason Wilder
|
2022-01-14 14:29:03 +01:00
|
|
|
org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
|
2021-04-06 00:11:53 +02:00
|
|
|
|
|
|
|
- name: Set up QEMU
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-04-06 00:11:53 +02:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-04-06 00:11:53 +02:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/login-action@v2
|
2021-04-06 00:11:53 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2022-12-03 14:30:40 +01:00
|
|
|
|
2022-03-04 10:59:50 +01:00
|
|
|
- name: Log in to GitHub Container Registry
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/login-action@v2
|
2022-03-04 10:59:50 +01:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-06 00:11:53 +02:00
|
|
|
|
2023-05-02 05:21:41 +02:00
|
|
|
- name: Retrieve docker-gen version
|
|
|
|
id: docker-gen_version
|
|
|
|
run: sed -n -e 's;^FROM nginxproxy/docker-gen:\([0-9.]*\).*;VERSION=\1;p' Dockerfile >> "$GITHUB_OUTPUT"
|
|
|
|
|
2021-04-06 00:11:53 +02:00
|
|
|
- name: Build and push the Debian based image
|
|
|
|
id: docker_build_debian
|
2023-04-30 13:17:20 +00:00
|
|
|
uses: docker/build-push-action@v4
|
2021-04-06 00:11:53 +02:00
|
|
|
with:
|
2021-09-08 14:25:56 +02:00
|
|
|
context: .
|
2021-04-06 00:11:53 +02:00
|
|
|
file: Dockerfile
|
2023-05-02 05:21:41 +02:00
|
|
|
build-args: |
|
|
|
|
NGINX_PROXY_VERSION=${{ steps.nginx-proxy_version.outputs.VERSION }}
|
|
|
|
DOCKER_GEN_VERSION=${{ steps.docker-gen_version.outputs.VERSION }}
|
2021-04-06 00:11:53 +02:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.docker_meta_debian.outputs.tags }}
|
|
|
|
labels: ${{ steps.docker_meta_debian.outputs.labels }}
|
|
|
|
|
|
|
|
- name: Images digests
|
|
|
|
run: echo ${{ steps.docker_build_debian.outputs.digest }}
|
|
|
|
|
|
|
|
multiarch-build-alpine:
|
2023-04-30 15:51:46 +02:00
|
|
|
name: Build and publish Alpine image
|
2021-04-06 00:11:53 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-03 19:36:31 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-04-06 00:11:53 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-12-03 14:30:40 +01:00
|
|
|
|
2023-05-02 05:21:41 +02:00
|
|
|
- name: Retrieve nginx-proxy version
|
|
|
|
id: nginx-proxy_version
|
|
|
|
run: echo "VERSION=$(git describe --tags)" >> "$GITHUB_OUTPUT"
|
2021-04-06 00:11:53 +02:00
|
|
|
|
2021-04-01 12:14:32 +02:00
|
|
|
- name: Get Docker tags for Alpine based image
|
|
|
|
id: docker_meta_alpine
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/metadata-action@v4
|
2021-04-01 12:14:32 +02:00
|
|
|
with:
|
2021-04-02 00:39:41 +02:00
|
|
|
images: |
|
2022-03-04 11:10:14 +01:00
|
|
|
ghcr.io/nginx-proxy/nginx-proxy
|
2021-04-02 00:39:41 +02:00
|
|
|
nginxproxy/nginx-proxy
|
|
|
|
jwilder/nginx-proxy
|
|
|
|
tags: |
|
|
|
|
type=semver,suffix=-alpine,pattern={{version}}
|
|
|
|
type=semver,suffix=-alpine,pattern={{major}}.{{minor}}
|
2022-12-03 14:34:15 +01:00
|
|
|
type=raw,value=alpine,enable={{is_default_branch}}
|
2022-01-14 14:29:03 +01:00
|
|
|
labels: |
|
2022-01-14 14:39:33 +01:00
|
|
|
org.opencontainers.image.authors=Nicolas Duchon <nicolas.duchon@gmail.com> (@buchdag), Jason Wilder
|
2022-01-14 14:29:03 +01:00
|
|
|
org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
|
2021-04-02 00:39:41 +02:00
|
|
|
flavor: latest=false
|
2021-04-01 12:14:32 +02:00
|
|
|
|
|
|
|
- name: Set up QEMU
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-04-06 00:11:53 +02:00
|
|
|
|
2021-04-01 12:14:32 +02:00
|
|
|
- name: Set up Docker Buildx
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-04-06 00:11:53 +02:00
|
|
|
|
2021-04-01 12:14:32 +02:00
|
|
|
- name: Login to DockerHub
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/login-action@v2
|
2021-04-01 12:14:32 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2022-12-03 14:30:40 +01:00
|
|
|
|
2022-03-04 11:10:14 +01:00
|
|
|
- name: Log in to GitHub Container Registry
|
2022-12-03 14:34:15 +01:00
|
|
|
uses: docker/login-action@v2
|
2022-03-04 11:10:14 +01:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-01 12:14:32 +02:00
|
|
|
|
2023-05-02 05:21:41 +02:00
|
|
|
- name: Retrieve docker-gen version
|
|
|
|
id: docker-gen_version
|
|
|
|
run: sed -n -e 's;^FROM nginxproxy/docker-gen:\([0-9.]*\).*;VERSION=\1;p' Dockerfile >> "$GITHUB_OUTPUT"
|
|
|
|
|
2021-04-01 12:14:32 +02:00
|
|
|
- name: Build and push the Alpine based image
|
|
|
|
id: docker_build_alpine
|
2023-04-30 13:17:20 +00:00
|
|
|
uses: docker/build-push-action@v4
|
2021-04-01 12:14:32 +02:00
|
|
|
with:
|
2021-09-08 14:25:56 +02:00
|
|
|
context: .
|
2021-04-01 12:14:32 +02:00
|
|
|
file: Dockerfile.alpine
|
2023-05-02 05:21:41 +02:00
|
|
|
build-args: |
|
|
|
|
NGINX_PROXY_VERSION=${{ steps.nginx-proxy_version.outputs.VERSION }}
|
|
|
|
DOCKER_GEN_VERSION=${{ steps.docker-gen_version.outputs.VERSION }}
|
2021-04-01 22:23:37 +02:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
2021-04-01 12:14:32 +02:00
|
|
|
push: true
|
2021-04-02 00:39:41 +02:00
|
|
|
tags: ${{ steps.docker_meta_alpine.outputs.tags }}
|
|
|
|
labels: ${{ steps.docker_meta_alpine.outputs.labels }}
|
2021-04-01 12:14:32 +02:00
|
|
|
|
|
|
|
- name: Images digests
|
2021-04-06 00:11:53 +02:00
|
|
|
run: echo ${{ steps.docker_build_alpine.outputs.digest }}
|