Skip to content

Commit

Permalink
initial github-actions test
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Dec 4, 2020
1 parent 957a4bd commit b809ac2
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# implement caching from latest(so no building redundant steps)
# use local cache on tests(so no pulling)
name: docker-compose-actions-workflow
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set ENV variables
run: |
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
cat .env >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: |
network=host
cache-from: type=registry,ref=${{ secrets.HUB_USERNAME }}/paper_trail:${{ env.BRANCH_NAME }}
cache-to: type=inline
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.HUB_USERNAME }}
password: ${{ secrets.HUB_KEY }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.HUB_USERNAME }}/paper_trail:${{ env.BRANCH_NAME }}
- name: Checkout
uses: actions/checkout@v2
- name: docker up
run: |
sed -i $(echo "s/\$DOCKER_TAG/paper_trail:$BRANCH_NAME/g") .env
docker-compose run paper_trail mix test test/paper_trail
- name: docker ps
run: |
docker ps
env:
DOCKER_TAG: paper_trail:${{ env.BRANCH_NAME }}

0 comments on commit b809ac2

Please sign in to comment.