-
Notifications
You must be signed in to change notification settings - Fork 12
90 lines (87 loc) · 3.2 KB
/
ci-dedup.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
# This workflow will download test data and then build
# and verify VideoDeduplication-app Docker image.
name: CI Deduplication
# Execute integration tests on each pull request
# and each push to the development and master branch.
on:
push:
branches: [ development, master ]
pull_request:
branches: [ development, master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Maximize build space
run: |
echo "Available storage:"
df -h
echo
sudo apt clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Available storage:"
df -h
echo
- name: Checkout
uses: actions/checkout@v2
- name: Copy test data
run: aws s3 cp s3://justiceaitestdata ./tests/test_data --region us-east-1 --recursive --no-sign-request
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Execute Tests
uses: docker/build-push-action@v2
with:
push: false
context: .
file: ./docker/Dockerfile.dedup-cpu
target: tests
- name: Login to Docker Hub
if: github.event_name == 'push'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# This may be required to prevent hitting
# GitHub action disk space limit (14GB)
- name: Clean Docker Cache
if: github.event_name == 'push'
run: |
docker image prune -f
# Workaround to increase available disk space: remove unnecessary tool chains.
# See https://github.com/actions/virtual-environments/issues/709#issuecomment-612569242
rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Build and Push CPU Image
if: github.event_name == 'push'
uses: docker/build-push-action@v2
with:
push: true
tags: johnhbenetech/videodeduplication:cpu${{ github.ref != 'refs/heads/master' && '-dev' || '' }}
context: .
file: ./docker/Dockerfile.dedup-cpu
target: prod
build-args: |
GIT_HASH=${{ github.sha }}
# This may be required to prevent hitting
# GitHub action disk space limit (14GB)
- name: Clean Docker Cache
if: github.event_name == 'push'
run: |
docker image prune -a -f
- name: Build and Push GPU Image
if: github.event_name == 'push'
uses: docker/build-push-action@v2
with:
push: true
tags: johnhbenetech/videodeduplication:gpu${{ github.ref != 'refs/heads/master' && '-dev' || '' }}
context: .
file: ./docker/Dockerfile.dedup-gpu
target: prod
build-args: |
GIT_HASH=${{ github.sha }}