-
Notifications
You must be signed in to change notification settings - Fork 11
54 lines (48 loc) · 1.46 KB
/
run_tests.yaml
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
name: Relation Engine test and deploy
on:
pull_request:
types:
- opened
- synchronize
- ready_for_review
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- name: checkout git repo
uses: actions/checkout@v2
- name: run tests
shell: bash
env:
GITHUB_ACTIONS_CI: 1
run: |
docker-compose build
docker-compose run re_api sh scripts/run_tests.sh
docker-compose down --remove-orphans
docker_build_and_push:
runs-on: ubuntu-latest
needs: run_tests
if: (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && github.event_name == 'push' && !contains(github.event.head_commit.message, 'skip_docker_build')
steps:
- name: checkout git repo
uses: actions/checkout@v2
- name: copy VERSION to TAG_NAME
shell: bash
run: |
mkdir -p .target
cp VERSION .target/TAG_NAME
- name: set env vars
shell: bash
run: |
echo "DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
echo "BRANCH=$(git symbolic-ref --short HEAD)" >> $GITHUB_ENV
echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: build and push to dockerhub
uses: opspresso/action-docker@master
with:
args: --docker
env:
USERNAME: ${{ secrets.DOCKER_USERNAME }}
PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERFILE: "Dockerfile"
IMAGE_NAME: "kbase/relation_engine_api"