Publish LTS Container Images #107
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish LTS Container Images | |
on: | |
push: | |
tags: | |
- '5.*' | |
jobs: | |
lint_dockerfiles: | |
name: 'Lint Dockerfile with hadolint' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dockerfile: | |
- 5.0/apache/Dockerfile | |
- 5.0/fpm-alpine/Dockerfile | |
- 5.0/fpm/Dockerfile | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- uses: hadolint/[email protected] | |
with: | |
dockerfile: ${{ matrix.dockerfile }} | |
ignore: "DL4006,DL3008,DL3018" | |
push_images_to_registries: | |
name: 'Push container images to registries' | |
runs-on: ubuntu-latest | |
needs: [lint_dockerfiles] | |
environment: docker-build | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: 'Check out the repo' | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
- name: 'Set up QEMU' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: 'arm64,arm' | |
- name: 'Set up Docker Buildx' | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-flags: --debug | |
- name: 'Log in to DockerHub' | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: 'Apache variant metadata' | |
id: metadata-apache | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
docker.io/martialblog/limesurvey | |
tags: | | |
type=match,pattern=(.+),group=1 | |
type=match,pattern=^(\d+),group=1 | |
flavor: | | |
latest=false | |
suffix=-apache | |
- name: 'Build and push LTS apache container images' | |
uses: docker/build-push-action@v5 | |
with: | |
context: 5.0/apache | |
push: true | |
tags: ${{ steps.metadata-apache.outputs.tags }} | |
labels: ${{ steps.metadata-apache.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
- name: 'FPM variant metadata' | |
id: metadata-fpm | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
docker.io/martialblog/limesurvey | |
tags: | | |
type=match,pattern=(.+),group=1 | |
type=match,pattern=^(\d+),group=1 | |
flavor: | | |
latest=false | |
suffix=-fpm | |
- name: 'Build and push LTS fpm container images' | |
uses: docker/build-push-action@v5 | |
with: | |
context: 5.0/fpm | |
push: true | |
tags: ${{ steps.metadata-fpm.outputs.tags }} | |
labels: ${{ steps.metadata-apache.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
- name: 'FPM Alpine variant metadata' | |
id: metadata-fpm-alpine | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
docker.io/martialblog/limesurvey | |
tags: | | |
type=match,pattern=(.+),group=1 | |
type=match,pattern=^(\d+),group=1 | |
flavor: | | |
latest=false | |
suffix=-fpm-alpine | |
- name: 'Build and push LTS fpm-alpine container images' | |
uses: docker/build-push-action@v5 | |
with: | |
context: 5.0/fpm-alpine | |
push: true | |
tags: ${{ steps.metadata-fpm-alpine.outputs.tags }} | |
labels: ${{ steps.metadata-apache.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 |