update deps #83
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: docker build . --build-arg DEV_MODE=true -t naive_feedya_test_build | |
- name: Run tests | |
run: docker run -i naive_feedya_test_build /usr/share/python3/app/bin/pytest --asyncio-mode=auto | |
- name: Run linter | |
run: docker run -i naive_feedya_test_build /usr/share/python3/app/bin/flake8 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and deploy master image Dockerhub | |
if: ${{ github.ref == 'refs/heads/main' }} | |
env: | |
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | |
USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | |
GITHUB_SHA: ${{ github.sha}} | |
GITHUB_REF: ${{ github.ref}} | |
run: | | |
ref="$(echo ${GITHUB_REF} | cut -d'/' -f3)" | |
echo GITHUB_REF - $ref | |
echo ${DOCKER_HUB_TOKEN} | docker login -u ${USERNAME} --password-stdin | |
docker buildx build --push \ | |
--build-arg GITHUB_SHA=${GITHUB_SHA} --build-arg GIT_BRANCH=${ref} \ | |
-t ${USERNAME}/naive-feedya:${ref} . |