forked from CogStack/MedCATservice
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·92 lines (72 loc) · 2.59 KB
/
docker.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
90
91
92
name: Docker
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
working-directory: ./
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: checkout repo
uses: actions/checkout@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: cogstacksystems/medcat-service:latest
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: actions/checkout@v2
- name: Get and set release version env var
id: release_version
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "::set-output name=RELEASE_VERSION::$RELEASE_VERSION"
- name: output test
run: |
echo ${{ env.RELEASE_VERSION }}
echo $RELEASE_VERSION
- name: set docker release tag name
id: set_release_version
if: ${{ env.RELEASE_VERSION != 'master' }}
run: echo "RELEASE_VERSION=${RELEASE_VERSION#?}" >> $GITHUB_ENV
- name: set docker release tag name
id: set_release_version_latest
if: ${{ env.RELEASE_VERSION == 'master' }}
run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
- name: Build and push Docker MedCATservice image
id: docker_build
uses: docker/build-push-action@v2
with:
context : .
file : "Dockerfile"
allow: network.host
github-token: ${{ github.token }}
tags: cogstacksystems/medcat-service:${{ env.RELEASE_VERSION }}
push: true
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker Jupyter singleuser image with GPU support
id: docker_build_gpu
uses: docker/build-push-action@v2
with:
context : .
file : "Dockerfile_gpu"
allow: network.host
github-token: ${{ github.token }}
tags: cogstacksystems/medcat-service-gpu:${{ env.RELEASE_VERSION }}
push: true
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}