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