Update dependencies and workflows (#2185)
This commit is contained in:
parent
47ea958441
commit
5191638f8e
5 changed files with 61 additions and 7 deletions
25
.github/workflows/docker-build.yml
vendored
25
.github/workflows/docker-build.yml
vendored
|
|
@ -52,14 +52,33 @@ jobs:
|
|||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push Base Image
|
||||
- name: Build Docker Image
|
||||
uses: docker/build-push-action@v5
|
||||
id: docker_build
|
||||
with:
|
||||
context: .
|
||||
push: false # Do not push yet
|
||||
platforms: "linux/amd64,linux/arm64/v8"
|
||||
file: ${{ matrix.file }}
|
||||
tags: ${{ needs.setup.outputs.tags }}
|
||||
- name: Run Container
|
||||
run: |
|
||||
docker run -d --name test_container -p 8000:8000 ${{ needs.setup.outputs.tags }}
|
||||
- name: Wait for Container to Start
|
||||
run: |
|
||||
timeout 40 bash -c 'until curl -f http://127.0.0.1:8000/health; do sleep 1; done' || (echo "Server did not start in time" && docker logs test_container && docker stop test_container && docker rm test_container && exit 1)
|
||||
- name: Stop and Remove Container
|
||||
run: |
|
||||
docker stop test_container
|
||||
docker rm test_container
|
||||
- name: Push Docker Image
|
||||
if: success()
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
push: true # Push only if the tests pass
|
||||
platforms: "linux/amd64,linux/arm64/v8"
|
||||
file: ${{ matrix.file }}
|
||||
# base_rags if release_type is base, main_tags if release_type is main
|
||||
tags: ${{ needs.setup.outputs.tags }}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue