Skip to content
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
40 changes: 40 additions & 0 deletions .github/workflows/yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Do not edit this file! Make a pull request on changing
# github/workflows/yaml.yaml in
# https://github.com/itk-dev/devops_itkdev-docker if need be.

### ### YAML
###
### Validates YAML files.
###
### #### Assumptions
###
### 1. A docker compose service named `prettier` for running
### [Prettier](https://prettier.io/) exists.
###
### #### Symfony YAML
###
### Symfony's YAML config files use 4 spaces for indentation and single quotes.
### Therefore we use a [Prettier configuration
### file](https://prettier.io/docs/configuration), `.prettierrc.yaml`, to make
### Prettier format YAML files in the `config/` folder like Symfony expects.

name: YAML

on:
pull_request:
push:
branches:
- main
- develop

jobs:
yaml-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: |
docker network create frontend

- run: |
docker compose run --rm prettier '**/*.{yml,yaml}' --check
3 changes: 2 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://taskfile.dev

version: '3'
version: "3"

includes:
github-actions: ./task/Taskfile.github-actions.yml
Expand All @@ -22,6 +22,7 @@ tasks:
build:
desc: "Build everything"
cmds:
- task: github-actions:config-headers:update
- task: github-actions:template-headers:update
- task: github-actions:documentation:update
- task: github-actions:link
Expand Down
11 changes: 11 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,14 @@ services:
- dev
volumes:
- ./:/md

prettier:
# Prettier does not (yet, fcf.
# https://github.com/prettier/prettier/issues/15206) have an official
# docker image.
# https://hub.docker.com/r/jauderho/prettier is good candidate (cf. https://hub.docker.com/search?q=prettier&sort=updated_at&order=desc)
image: jauderho/prettier
profiles:
- dev
volumes:
- ./:/work
11 changes: 11 additions & 0 deletions config/symfony/yaml/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file is copied from config/symfony/yaml/.prettierrc.yaml in https://github.com/itk-dev/devops_itkdev-docker.
# Feel free to edit the file, but consider making a pull request if you find a general issue with the file.

# https://prettier.io/docs/configuration
overrides:
# Symfony config
- files:
- "config/**/*.{yml,yaml}"
options:
tabWidth: 4
singleQuote: true
22 changes: 21 additions & 1 deletion docs/github-actions-templates.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- DO NOT EDIT THIS FILE!

It was automatically created at 2025-05-20T13:49:11+02:00
It was automatically created at 2025-06-12T14:50:42+02:00
by task/scripts/github-documentation-update
based on /app/task/scripts/../templates/github-actions-templates.md
-->
Expand Down Expand Up @@ -299,6 +299,26 @@ Validates Twig files

---

[github/workflows/yaml.yaml](github/workflows/yaml.yaml)

### YAML

Validates YAML files.

#### Assumptions

1. A docker compose service named `prettier` for running
[Prettier](https://prettier.io/) exists.

#### Symfony YAML

Symfony's YAML config files use 4 spaces for indentation and single quotes.
Therefore we use a [Prettier configuration
file](https://prettier.io/docs/configuration), `.prettierrc.yaml`, to make
Prettier format YAML files in the `config/` folder like Symfony expects.

---

## Updating template documentation

To update this document, run
Expand Down
40 changes: 40 additions & 0 deletions github/workflows/yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Do not edit this file! Make a pull request on changing
# github/workflows/yaml.yaml in
# https://github.com/itk-dev/devops_itkdev-docker if need be.

### ### YAML
###
### Validates YAML files.
###
### #### Assumptions
###
### 1. A docker compose service named `prettier` for running
### [Prettier](https://prettier.io/) exists.
###
### #### Symfony YAML
###
### Symfony's YAML config files use 4 spaces for indentation and single quotes.
### Therefore we use a [Prettier configuration
### file](https://prettier.io/docs/configuration), `.prettierrc.yaml`, to make
### Prettier format YAML files in the `config/` folder like Symfony expects.

name: YAML

on:
pull_request:
push:
branches:
- main
- develop

jobs:
yaml-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: |
docker network create frontend

- run: |
docker compose run --rm prettier '**/*.{yml,yaml}' --check
4 changes: 2 additions & 2 deletions task/Taskfile.github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: "3"

tasks:
documentation:update:
Expand All @@ -19,7 +19,7 @@ tasks:
- git diff --exit-code --ignore-blank-lines --ignore-matching-lines='automatically created' '*.md'

documentation:checkout:
desc: 'git checkout all translation file changes if only date metadata is changed'
desc: "git checkout all translation file changes if only date metadata is changed"
cmds:
- git checkout '*.md'
# https://taskfile.dev/reference/schema#precondition
Expand Down
1 change: 1 addition & 0 deletions templates/drupal-10/.github/workflows/yaml.yaml
2 changes: 1 addition & 1 deletion templates/drupal-10/docker-compose.server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"

memcached:
image: 'memcached:latest'
image: "memcached:latest"
restart: unless-stopped
networks:
- app
Expand Down
16 changes: 8 additions & 8 deletions templates/drupal-10/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ services:
networks:
- app
ports:
- '3306'
- "3306"
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
Expand All @@ -27,7 +27,7 @@ services:
#- ENCRYPT=1 # Uncomment to enable database encryption.
# https://symfony.com/doc/current/setup/symfony_server.html#docker-integration
labels:
com.symfony.server.service-prefix: 'DATABASE'
com.symfony.server.service-prefix: "DATABASE"

phpfpm:
image: itkdev/php8.3-fpm:latest
Expand Down Expand Up @@ -62,7 +62,7 @@ services:
depends_on:
- phpfpm
ports:
- '8080'
- "8080"
volumes:
- ./.docker/templates:/etc/nginx/templates:ro
- .:/app
Expand All @@ -75,16 +75,16 @@ services:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)"
# HTTPS config - uncomment to enable redirect from :80 to :443
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# HTTPS config - uncomment to enable redirect from :80 to :443
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"

memcached:
image: memcached:alpine
networks:
- app
ports:
- '11211'
- "11211"
healthcheck:
test: echo "version" | nc -vn -w 1 127.0.0.1 11211
interval: 10s
Expand Down
1 change: 1 addition & 0 deletions templates/drupal-11/.github/workflows/yaml.yaml
2 changes: 1 addition & 1 deletion templates/drupal-11/docker-compose.server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"

memcached:
image: 'memcached:latest'
image: "memcached:latest"
restart: unless-stopped
networks:
- app
Expand Down
8 changes: 4 additions & 4 deletions templates/drupal-11/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ services:
networks:
- app
ports:
- '3306'
- "3306"
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
Expand Down Expand Up @@ -59,7 +59,7 @@ services:
depends_on:
- phpfpm
ports:
- '8080'
- "8080"
volumes:
- ./.docker/templates:/etc/nginx/templates:ro
- .:/app
Expand All @@ -81,7 +81,7 @@ services:
networks:
- app
ports:
- '11211'
- "11211"
healthcheck:
test: echo "version" | nc -vn -w 1 127.0.0.1 11211
interval: 10s
Expand Down
1 change: 1 addition & 0 deletions templates/drupal-7/.github/workflows/yaml.yaml
2 changes: 1 addition & 1 deletion templates/drupal-7/docker-compose.server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"

memcached:
image: 'memcached:latest'
image: "memcached:latest"
restart: unless-stopped
networks:
- app
Expand Down
18 changes: 9 additions & 9 deletions templates/drupal-7/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ services:
networks:
- app
ports:
- '3306'
- "3306"
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
Expand All @@ -27,7 +27,7 @@ services:
#- ENCRYPT=1 # Uncomment to enable database encryption.
# https://symfony.com/doc/current/setup/symfony_server.html#docker-integration
labels:
com.symfony.server.service-prefix: 'DATABASE'
com.symfony.server.service-prefix: "DATABASE"

phpfpm:
image: itkdev/php7.4-fpm:latest
Expand Down Expand Up @@ -61,7 +61,7 @@ services:
depends_on:
- phpfpm
ports:
- '8080'
- "8080"
volumes:
- ./.docker/templates:/etc/nginx/templates:ro
- .:/app
Expand All @@ -74,16 +74,16 @@ services:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)"
# HTTPS config - uncomment to enable redirect from :80 to :443
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# HTTPS config - uncomment to enable redirect from :80 to :443
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"

memcached:
image: 'memcached:latest'
image: "memcached:latest"
networks:
- app
ports:
- '11211'
- "11211"
healthcheck:
test: echo "version" | nc -vn -w 1 127.0.0.1 11211
interval: 10s
Expand Down
1 change: 1 addition & 0 deletions templates/drupal-8/.github/workflows/yaml.yaml
2 changes: 1 addition & 1 deletion templates/drupal-8/docker-compose.server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"

memcached:
image: 'memcached:latest'
image: "memcached:latest"
restart: unless-stopped
networks:
- app
Expand Down
Loading