add pull previous images for caching, flake8 dep

This commit is contained in:
Abigail Gold 2020-02-25 21:35:17 -05:00 committed by GitHub
parent 6b04ab59d1
commit fc7403c208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -19,9 +19,17 @@ jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: flake8_py3
steps:
- uses: actions/checkout@v2
- name: Pull previous images
run: |
docker pull -a ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME
# OR
[[ "${{ github.ref }}" == "refs/tags/"* ]] && docker pull ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:$(echo ${{ github.ref }} | sed -e 's,^refs/tags/v,,')
[[ "${{ github.ref }}" == "refs/heads/master" ]] && docker pull ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:dev
- name: Build image
run: docker build . --file Dockerfile
@ -46,7 +54,7 @@ jobs:
docker tag image $IMAGE_ID:$VERSION
# use Docker `latest` convention for versioned releases
[[ "$VERSION" != "dev" ]] && docker tag image $IMAGE_ID:latest
[ "$VERSION" != "dev" ] && docker tag image $IMAGE_ID:latest
docker push $IMAGE_ID:$VERSION
- name: Log out of Github Package Registry