Skip to content

Commit

Permalink
fix deployment to dockerhub (#1415)
Browse files Browse the repository at this point in the history
* ci: unit tests broken, attempt fix by running setup python before install poetry

* remove poetry cache

* fix deployment to dockerhub

The docker metadata action returns the branch (i.e. `master`) when a
push occurs. That causes docker push to fail because there's not master
tag in the registry.  We need to change to make it push to `latest`
tag in dockerhub registry.

* fix dependency
  • Loading branch information
zaro0508 authored Jan 15, 2024
1 parent 0549a32 commit b8d827a
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,32 @@ jobs:
# - name: run tests
# run: poetry run behave integration-tests/features --junit --junit-directory build/behave

docker-build-push:
docker-build-push-latest:
needs:
- docker-build
if: ${{ (github.ref == 'refs/heads/master') || (github.ref_type == 'tag') }}
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: latest
labels: ${{ steps.meta.outputs.labels }}
docker-build-push-tag:
needs:
- docker-build
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -141,7 +163,7 @@ jobs:
- packaging
- documentation
- unit-tests
- docker-build-push
- docker-build-push-tag
# - integration-tests
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest
Expand Down

0 comments on commit b8d827a

Please sign in to comment.