Skip to content

Commit 0d806d1

Browse files
authored
Merge pull request #8 from macbre/tests
Test nginx docker builds with a static file
2 parents d3668e0 + c998d7b commit 0d806d1

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.github/workflows/dockerimage.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ jobs:
2020

2121
- name: Run nginx -V
2222
run: docker run -t ${{ github.repository }} nginx -V
23+
24+
- name: Serve a static asset
25+
run: |
26+
docker run --detach --rm -p 0.0.0.0:8888:80 -v "$PWD/tests":/static:ro -v "$PWD/tests/static.conf":/etc/nginx/conf.d/static.conf:ro --name test_nginx -t ${{ github.repository }}
27+
sleep 2; docker ps
28+
curl -v --compressed 0.0.0.0:8888
29+
docker logs test_nginx

tests/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>nginx</h1>
2+
<p>It works!</p>

tests/static.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
5+
location / {
6+
root /static;
7+
8+
gzip_static on;
9+
brotli_static on;
10+
11+
expires 1d;
12+
}
13+
}

0 commit comments

Comments
 (0)