Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker builds #1845

Merged
merged 4 commits into from
Aug 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 38 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,45 @@ jobs:
- run: tox -e ${{ matrix.tox }}

verify_docker_build:
name: Verify Docker image build
name: Verify docker, push if on master
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: locustbuild
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: false
tags: locustio/locust:latest

push: ${{ github.ref == 'refs/heads/master' }}
tags: locustio/locust:master

docker_tagged:
name: Push to version-specific tag, also push latest if on master
needs: tests
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Get git tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: locustbuild
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: locustio/locust:${{ steps.tag.outputs.tag }}${{ (github.ref == 'refs/heads/master' && ',locustio/locust:latest') || '' }}

release:
name: Release to PyPI
needs: verify_docker_build
Expand All @@ -80,3 +107,10 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Push to docker
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: locustio/locust:${{ github.event.release.tag_name }} # tags the image based on git tag name instead of package version, but that should be good enough.