Skip to content

Commit

Permalink
Merge pull request #482 from kids-first/feature/gh-action
Browse files Browse the repository at this point in the history
Feature/gh action
  • Loading branch information
fiendish authored Sep 1, 2020
2 parents 6cc18b5 + 5ff59ae commit 5b6d4a5
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Publish

on:
release:
types: created

jobs:
build_publish:
needs: run_tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: kf-lib-data-ingest
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Run Tests

on: push

jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install virtualenv
run: |
pip install --upgrade virtualenv
virtualenv -p python3 venv
- name: Run tests
run: ./scripts/test.sh
1 change: 1 addition & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
set -e

. venv/bin/activate
pip install -e .
pip install -r dev-requirements.txt
py.test -s --cov=kf_lib_data_ingest tests

Expand Down

0 comments on commit 5b6d4a5

Please sign in to comment.