Skip to content

Subfolder location is now injected (when needed) into default.conf file. #339

Subfolder location is now injected (when needed) into default.conf file.

Subfolder location is now injected (when needed) into default.conf file. #339

name: Docker
on:
pull_request:
push:
branches: "feature/d8"
env:
IMAGE_NAME: docker-php-drupal-nginx
TAG_D8: d8
TAG_D8_RL: d8-rootless
jobs:
test:
strategy:
matrix:
version:
[
1.26.0-alpine-slim,
1.25.5-alpine-slim,
1.25.3-alpine-slim,
1.25.1-alpine-slim,
1.23.3-alpine-slim,
1.23.3-alpine,
1.23.1-alpine,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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.26.0-alpine-slim,
1.25.5-alpine-slim,
1.25.3-alpine-slim,
1.25.1-alpine-slim,
1.23.3-alpine-slim,
1.23.3-alpine,
1.23.1-alpine,
]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/feature/d8'
steps:
- uses: actions/checkout@v4
# 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@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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