split build and push image and test in between
This commit is contained in:
@@ -92,15 +92,14 @@ jobs:
|
||||
# [worker.oci]
|
||||
# max-parallelism = 1
|
||||
|
||||
- name: Build and push image
|
||||
- name: Build image
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
# load: true
|
||||
# push: false
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
load: true # Load the image into the Docker daemon
|
||||
push: false # Do not push the image at this stage
|
||||
platforms: linux/amd64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -116,12 +115,16 @@ jobs:
|
||||
|
||||
- name: Test runtime
|
||||
run: |
|
||||
tags="${{ steps.meta.outputs.tags }}"
|
||||
IFS=',' read -ra ADDR <<< "$tags" # Convert string to array using ',' as delimiter
|
||||
tag=${ADDR[0]} # Get the first tag
|
||||
|
||||
docker run --rm --network stack \
|
||||
-p 3000:3000 \
|
||||
-e DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@database/${{ env.POSTGRES_DB }} \
|
||||
-e NEXTAUTH_SECRET=${{ env.NEXTAUTH_SECRET }} \
|
||||
-e CALENDSO_ENCRYPTION_KEY=${{ env.CALENDSO_ENCRYPTION_KEY }} \
|
||||
docker.io/calcom/cal.com:add-runtime-check &
|
||||
$tag &
|
||||
|
||||
server_pid=$!
|
||||
|
||||
@@ -151,6 +154,23 @@ jobs:
|
||||
NEXTAUTH_SECRET: 'EI4qqDpcfdvf4A+0aQEEx8JjHxHSy4uWiZw/F32K+pA='
|
||||
CALENDSO_ENCRYPTION_KEY: '0zfLtY99wjeLnsM7qsa8xsT+Q0oSgnOL'
|
||||
|
||||
|
||||
- name: Push image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
# push: ${{ github.event_name != 'pull_request' }}
|
||||
push: false
|
||||
platforms: linux/amd64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
run: |
|
||||
tags="${{ steps.meta.outputs.tags }}"
|
||||
IFS=',' read -ra ADDR <<< "$tags" # Convert string to array using ',' as delimiter
|
||||
tag=${ADDR[0]} # Get the first tag
|
||||
|
||||
docker push $tag
|
||||
|
||||
- name: Cleanup
|
||||
run: |
|
||||
docker compose down
|
||||
|
||||
Reference in New Issue
Block a user