-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 2.13 KB
/
ci.yml
File metadata and controls
69 lines (57 loc) · 2.13 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
name: Build & Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
# - run: sudo apt install docker.io docker-compose
- uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: kapturebox/server:${{ github.sha }}
platforms: linux/amd64, linux/arm/v7
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- run: docker-compose -p server up -d
# some quick checks to see if it's working as intended
- run: while ! docker exec server_server_1 curl -vf localhost:9000/health; do sleep 2; done;
- run: docker-compose -p server logs
# run protractor tests against spun up instance
# TODO: use newman for this: https://learning.postman.com/docs/running-collections/using-newman-cli/command-line-integration-with-newman/
- run: docker run -v $(pwd)/app/tests:/tests --network server_default stoplight/prism:v2.0.5 conduct /tests/scenarios.json -e host=http://server:9000
tag-latest:
if: github.ref_name == 'master'
needs: build
# needs: [build, test]
runs-on: ubuntu-latest
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: tag image as latest
# docker image tagging stuff is less functional w/ multi arch. instead, interact directly with the registry.
run: |
curl -L https://github.com/regclient/regclient/releases/download/v0.4.5/regctl-linux-amd64 >regctl
chmod 755 regctl
./regctl image copy kapturebox/server:${{ github.sha }} kapturebox/server:latest