-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (49 loc) · 1.63 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
name: Update Image
on:
workflow_call:
inputs:
branch_name:
required: true
type: string
secrets:
DOCKERHUB_ACCOUNT:
required: true
DOCKERHUB_PASSWORD:
required: true
env:
IMAGE_PATH: openmss
BRANCH_NAME: ${{ inputs.branch_name }}
IMAGE_NAME: testing-${{ inputs.branch_name }}
jobs:
test-and-publish-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build image
run: |
set -x
docker build . --build-arg BRANCH=$BRANCH_NAME --tag $IMAGE_PATH/$IMAGE_NAME:latest
- name: Print conda list
run: |
docker run $IMAGE_PATH/$IMAGE_NAME:latest /bin/bash -c "
source /opt/conda/bin/activate mssenv &&
conda list
"
- name: Test image
timeout-minutes: 30
run: |
set -x
docker run $IMAGE_PATH/$IMAGE_NAME:latest /bin/bash -c "
git clone https://github.com/Open-MSS/MSS.git &&
cd MSS &&
git checkout $BRANCH_NAME &&
source /opt/conda/bin/activate mssenv &&
xvfb-run pytest -k 'not (browse_add_operation or add_operation or skyfield_data_expiration or test_handle_db_reset or test_handle_db_seed or test_mscolab_)' \
|| (for i in {1..5} \
; do xvfb-run pytest --last-failed --lfnf=none \
&& break \
; done)"
- name: Log into dockerhub
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_ACCOUNT }} --password-stdin
- name: Push image
run: docker push $IMAGE_PATH/$IMAGE_NAME:latest