-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.6 KB
/
Copy pathci.yml
File metadata and controls
84 lines (73 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: ci
# Docs-only changes (markdown, docs/, promo assets) skip the whole pipeline —
# nothing they touch affects compose, nginx or the images.
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'promo-assets/**'
- 'LICENSE'
- '.gitignore'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
- 'promo-assets/**'
- 'LICENSE'
- '.gitignore'
jobs:
validate:
name: compose and nginx
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare CI environment
run: |
cp .env.example .env
sed -i 's#^LOCAL_DIR=.*#LOCAL_DIR=/tmp/projects#' .env
mkdir -p /tmp/projects logs/php logs/nginx
printf 'services: {}\n' > compose.apps.yml
docker network create phpdocker-network
- name: Validate docker compose config
run: docker compose config -q
- name: Generate vhosts for every mode and validate with nginx -t
run: |
make nginx-conf template=php name=ci-php domain=ci-php.test root=/var/www/ci/public
make nginx-conf template=proxy name=ci-proxy domain=ci-proxy.test port=8000
make nginx-html-conf name=ci-html domain=ci-html.test root=/var/www/ci
make wordpress-conf name=ci-wp domain=ci-wp.test root=/var/www/wp || true
docker run --rm \
--add-host php-fpm:127.0.0.1 \
-v "$PWD/nginx/nginx.conf:/etc/nginx/nginx.conf:ro" \
-v "$PWD/nginx/conf.d:/etc/nginx/conf.d:ro" \
-v "$PWD/nginx/includes:/etc/nginx/includes:ro" \
nginx:1.29-alpine nginx -t
if grep -R '__[A-Z_]*__' nginx/conf.d/; then
echo "Unresolved placeholders"; exit 1
fi
lint:
name: hadolint and shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: hadolint php/Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: php/Dockerfile
ignore: DL3008,DL3003
- name: hadolint mariadb/Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: mariadb/Dockerfile
ignore: DL3008
- name: hadolint certbot/Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: certbot/Dockerfile
- name: shellcheck
run: |
sudo apt-get update -q && sudo apt-get install -y -q shellcheck
shellcheck scripts/*.sh examples/demo-app/container_config/entrypoint.sh
# The prod image build lives in ci-image.yml and only runs when php/ changes.