-
Notifications
You must be signed in to change notification settings - Fork 36
28 lines (25 loc) · 999 Bytes
/
build_image.yml
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
name: Build & Test MKDocs
on:
push:
branches: [issue/*, feature/*]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: |
export RELEASE=$(grep "MKDOCS_VERSION=" Dockerfile | sed 's|^.*=||g' |awk '{print $1}' | sed 's|"||g')
docker build . --file Dockerfile --tag polinux/mkdocs:${RELEASE}
- name: Test image
run: |
export RELEASE=$(grep "MKDOCS_VERSION=" Dockerfile | sed 's|^.*=||g' |awk '{print $1}' | sed 's|"||g')
docker run -d --cap-add NET_ADMIN -p 8000:8000 --name mkdocs polinux/mkdocs:${RELEASE}
sleep 10
curl -sSLi http://127.0.0.1:8000 | grep '200 OK'
# Test custom port
docker run -d --cap-add NET_ADMIN -p 8001:9000 --name custom -e "DEV_ADDR=0.0.0.0:9000" polinux/mkdocs:${RELEASE}
sleep 10
curl -sSLi http://127.0.0.1:8001 | grep '200 OK'