🔧 (docker-build.yml): add TEST_TAG environment variable to specify the test tag for the Docker image

🔧 (docker-build.yml): update tags value to use the TEST_TAG environment variable for Docker image tagging
This commit is contained in:
ogabrielluiz 2024-06-15 11:51:04 -03:00
commit 7b89ff5cfb

View file

@ -21,6 +21,7 @@ on:
- main - main
env: env:
POETRY_VERSION: "1.8.2" POETRY_VERSION: "1.8.2"
TEST_TAG: "langflowai/langflow:test"
jobs: jobs:
setup: setup:
@ -59,12 +60,13 @@ jobs:
context: . context: .
push: false # Do not push yet push: false # Do not push yet
platforms: "linux/amd64,linux/arm64/v8" platforms: "linux/amd64,linux/arm64/v8"
load: true
file: ${{ matrix.file }} file: ${{ matrix.file }}
tags: ${{ needs.setup.outputs.tags }} tags: ${{ env.TEST_TAG }}
- name: Run Container - name: Run Container
run: | run: |
docker run -d --name test_container -p 8000:8000 ${{ needs.setup.outputs.tags }} docker run -d --name test_container -p 8000:8000 ${{ needs.setup.outputs.tags }}
- name: Wait for Container to Start - name: Wait for Container to Start and Check Health
run: | 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) 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 - name: Stop and Remove Container