diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 1b864459..94f9c841 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -1,6 +1,8 @@ name: Relation Engine test and deploy on: - [push, pull_request] + push: + branches: [ develop, master ] + pull_request_target: jobs: run_tests: runs-on: ubuntu-latest @@ -17,33 +19,35 @@ jobs: 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" +# 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 }} +# [push, pull_request] +# PASSWORD: ${{ secrets.DOCKER_PASSWORD }} +# DOCKERFILE: "Dockerfile" +# IMAGE_NAME: "kbase/relation_engine_api" diff --git a/relation_engine_server/README.md b/relation_engine_server/README.md index 8a3369df..cb5bd033 100644 --- a/relation_engine_server/README.md +++ b/relation_engine_server/README.md @@ -460,9 +460,9 @@ make test ## Deployment -The docker image is pushed to Docker Hub when new commits are made to master. The script that runs when pushing to docker hub is found in `hooks/build`. +Deploy the image by running the `scripts/docker_deploy` script. -Alternatively, set the image name in `scripts/local-build.sh` and run it to build and deploy locally, which may be a lot faster. +The image tag will be taken from the `VERSION` file found in the root of the repo. ## Project anatomy