forked from STEPbySTEPproj/Protocol_biomechanics
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (56 loc) · 2.35 KB
/
deploy.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
name: Deploy Docker image
on:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check secret available
env:
SECRET_DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
SECRET_DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
run: |
if [[ -z "$SECRET_DOCKERHUB_PASSWORD" ]]; then
echo "Missing variable SECRET_DOCKERHUB_PASSWORD"
exit 1
fi
if [[ -z "$SECRET_DOCKERHUB_USERNAME" ]]; then
echo "Missing variable SECRET_DOCKERHUB_USERNAME"
exit 1
fi
- name: Get latest release version number
id: get_version
uses: battila7/get-version-action@v2
- name: Check image name
env:
REPO_NAME: pi_sbs_biomechanics
# not accepted as the repo contains uppercase letters
#REPO_NAME: ${{ github.event.repository.name }}
VERSION: ${{ steps.get_version.outputs.version }}
run: echo "docker image name would be $REPO_NAME:$VERSION"
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build the Docker image
env:
REPO_NAME: pi_sbs_biomechanics
# not accepted as the repo contains uppercase letters
#REPO_NAME: ${{ github.event.repository.name }}
VERSION: ${{ steps.get_version.outputs.version }}
run: docker build . --file Dockerfile --tag eurobenchtest/$REPO_NAME:$VERSION
- name: Get the docker image testing material
run: wget -O test_docker_call.py https://raw.githubusercontent.com/eurobench/docker_test/master/test_docker_call.py
- name: test the Docker image
env:
DOCKER_IMAGE: eurobenchtest/pi_sbs_biomechanics:${{ steps.get_version.outputs.version }}
#DOCKER_IMAGE: eurobenchtest/${{ github.event.repository.name }}:${{ steps.get_version.outputs.version }}
TEST_PLAN: pi_algo/pi_algo/tests/test_plan.xml
run: python3 test_docker_call.py
- name: Push to Docker hub
env:
REPO_NAME: pi_sbs_biomechanics
# not accepted as the repo contains uppercase letters
#REPO_NAME: ${{ github.event.repository.name }}
VERSION: ${{ steps.get_version.outputs.version }}
run: docker push eurobenchtest/$REPO_NAME:$VERSION