-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (83 loc) · 2.39 KB
/
Copy pathdocker.yml
File metadata and controls
100 lines (83 loc) · 2.39 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: "Docker"
on:
workflow_dispatch:
push:
branches: ["master"]
schedule:
- cron: "0 8 * * 1"
permissions:
contents: read
jobs:
test:
name: "Test"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build image for testing
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
push: false
tags: dockette/apidoc:latest-test
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Test Caddy is running
run: |
docker run --rm -d --name apidoc-test -p 8000:8000 dockette/apidoc:latest-test
sleep 2
curl -sf http://localhost:8000/ > /dev/null
echo "Landing page OK"
- name: Test Swagger UI
run: |
curl -sf http://localhost:8000/swagger/ > /dev/null
echo "Swagger UI OK"
- name: Test Redoc
run: |
curl -sf http://localhost:8000/redoc/ > /dev/null
echo "Redoc OK"
- name: Test Stoplight Elements
run: |
curl -sf http://localhost:8000/elements/ > /dev/null
echo "Stoplight Elements OK"
- name: Test RapiDoc
run: |
curl -sf http://localhost:8000/rapidoc/ > /dev/null
echo "RapiDoc OK"
- name: Test Scalar
run: |
curl -sf http://localhost:8000/scalar/ > /dev/null
echo "Scalar OK"
- name: Cleanup
if: always()
run: docker stop apidoc-test || true
build:
name: "Build"
needs: test
uses: dockette/.github/.github/workflows/docker.yml@master
secrets: inherit
with:
image: "dockette/apidoc"
tag: "latest"
context: "."
platforms: "linux/amd64,linux/arm64"
push: ${{ github.ref == 'refs/heads/master' }}
docs:
name: "Docs"
needs: build
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: dockette/apidoc