forked from Netflix/conductor
-
Notifications
You must be signed in to change notification settings - Fork 4
89 lines (73 loc) · 2.4 KB
/
docker-publish.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
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
name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `vfrinx2.0.3` tags as releases.
tags:
- vfrinx2*
workflow_dispatch:
env:
# TODO: Change variable to your image's name.
IMAGE_NAME: frinx/conductor-server
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
build-image-v2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Build image
run: docker build . --file docker/server/Dockerfile --tag $IMAGE_NAME:latest --build-arg git_commit=$(git rev-parse HEAD)
- name: Log into docker hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
publish-latest-v2:
runs-on: ubuntu-latest
needs: build-image-v2
steps:
- name: Inspect latest image
run: docker image inspect $IMAGE_NAME:latest
# - name: Push latest image
# run: docker push $IMAGE_NAME:latest
publish-release-v2:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: build-image-v2
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed -e 's/^vfrinx//')
- name: Push release image
run: docker tag $IMAGE_NAME:latest $IMAGE_NAME:${{ steps.get_version.outputs.VERSION }}
- name: Inspect release image
run: docker image inspect $IMAGE_NAME:${{ steps.get_version.outputs.VERSION }}
# - name: Push release image
# run: docker push $IMAGE_ID:${{ steps.get_version.outputs.VERSION }}
swagger-v2:
runs-on: ubuntu-latest
needs: build-image-v2
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Run conductor image
run: docker run -t --network host --entrypoint '' $IMAGE_NAME:latest sleep infinity
- name: Setup upterm session
uses: lhotari/action-upterm@v1