-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (39 loc) · 1.15 KB
/
ci.yaml
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
name: CI
on:
push:
pull_request:
schedule:
- cron: "0 0 1 * *" # run monthly
jobs:
build:
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
NAME: piqmie
TAG: "1.1.0"
BASE_URL: http://127.0.0.1:8080
DATA: a000000000000000000000000000000000000001
steps:
- name: Log into registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run web app in docker
run: |
docker run -d -p 8080:8080 ${REGISTRY}/${GITHUB_REPOSITORY_OWNER,,}/${NAME}:${TAG}
sleep 10
docker ps
- name: Test web app endpoints
run: |
HTTP_CODE=$(curl -I "${BASE_URL}/results/${DATA}" | grep HTTP | cut -f 2 -d " ")
echo $HTTP_CODE
if [ "$HTTP_CODE" != "200" ]; then
exit 1
fi
for p in $(echo statpep statprot statgrp statregrp); do
url=$(echo "${{ env.APP_BASE_URL }}/rest/${{ env.APP_DATA }}/$p")
echo "# $url #"
curl -s "$url" | jq .
done