Skip to content

refs platform/#2470: improve logging experience using structured logs #288

refs platform/#2470: improve logging experience using structured logs

refs platform/#2470: improve logging experience using structured logs #288

Workflow file for this run

name: Docker
on:
push:
branches:
- "feature/d8"
pull_request:
branches:
- "feature/d8"
env:
IMAGE_NAME: docker-php-drupal-nginx
TAG_D8: d8
TAG_D8_RL: d8-rootless
jobs:
test:
strategy:
matrix:
version:
[
1.25.1-alpine-slim,
1.23.3-alpine-slim,
1.23.3-alpine,
1.23.1-alpine,
1.21.6-alpine,
1.21.1-alpine,
1.17.6-alpine,
1.13.6-alpine,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build images
run: |
docker buildx build --load . \
--file Dockerfile \
--tag $IMAGE_NAME:${{ matrix.version }}.d8 \
--build-arg NGINX_IMAGE_TAG=${{ matrix.version }} \
--build-arg user=root
docker buildx build --load . \
--file Dockerfile \
--tag $IMAGE_NAME:${{ matrix.version }}.d8-rootless \
--build-arg NGINX_IMAGE_TAG=${{ matrix.version }} \
--build-arg user=1001
- name: Test images
shell: bash {0}
run: |
IMAGE_TAG=${{ matrix.version }}.d8 ./tests/tests.sh
IMAGE_TAG=${{ matrix.version }}.d8-rootless IMAGE_USER="unknown uid 1001" BASE_TESTS_PORT="8080" ./tests/tests.sh
deploy:
needs: test
strategy:
matrix:
version:
[
1.25.1-alpine-slim,
1.23.3-alpine-slim,
1.23.3-alpine,
1.23.1-alpine,
1.21.6-alpine,
1.21.1-alpine,
1.17.6-alpine,
1.13.6-alpine,
]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/feature/d8'
steps:
- uses: actions/checkout@v3
# Refs https://github.com/docker/login-action#github-container-registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push images to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase.
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
echo IMAGE_ID=$IMAGE_ID
PLATFORMS="${{ matrix.version == '1.13.6-alpine' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}"
echo PLATFORMS=$PLATFORMS
docker buildx build --push . --platform "$PLATFORMS" \
--file Dockerfile \
--tag $IMAGE_ID:${{ matrix.version }}.d8 \
--build-arg NGINX_IMAGE_TAG=${{ matrix.version }} \
--build-arg user=root
docker buildx build --push . --platform "$PLATFORMS" \
--file Dockerfile \
--tag $IMAGE_ID:${{ matrix.version }}.d8-rootless \
--build-arg NGINX_IMAGE_TAG=${{ matrix.version }} \
--build-arg user=1001
- name: Push d8 tag
if: ${{ matrix.version == '1.13.6-alpine' }}
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase.
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
echo IMAGE_ID=$IMAGE_ID
docker pull $IMAGE_ID:${{ matrix.version }}.d8
docker tag $IMAGE_ID:${{ matrix.version }}.d8 $IMAGE_ID:$TAG_D8
docker push $IMAGE_ID:$TAG_D8
docker pull $IMAGE_ID:${{ matrix.version }}.d8-rootless
docker tag $IMAGE_ID:${{ matrix.version }}.d8-rootless $IMAGE_ID:$TAG_D8_RL
docker push $IMAGE_ID:$TAG_D8_RL