Skip to content

Commit

Permalink
update test ci to use local image
Browse files Browse the repository at this point in the history
  • Loading branch information
loan-mgt committed Nov 10, 2024
1 parent 6d590e9 commit b582efe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ jobs:
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: test-image # Use a local image name, not involving any registry

- name: Build Docker image (single platform)
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64 # Specify a single platform for building
load: true # Load the image into Docker's local cache
tags: ${{ steps.meta.outputs.tags }}
tags: test-image:latest # Use a local tag
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run Docker container for testing
run: |
docker run -d -p 8080:8080 --name test_container ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}
docker run -d -p 8080:8080 --name test_container test-image:latest # Run with the locally built image
sleep 2 # Wait for 2 seconds to allow the server to start
- name: Test health endpoint
Expand Down

0 comments on commit b582efe

Please sign in to comment.