Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
talhainvenxion committed Oct 8, 2023
1 parent 2abb37e commit 0aac4c5
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
# Install npm dependencies, cache them correctly
# and run all Cypress tests
- name: Set Cypress baseUrl from Netlify

- name: Wait for Netlify deploy-preview URL
id: wait-for-url
run: |
retries=0
max_retries=10
while [[ $retries -lt $max_retries ]]; do
export DEPLOY_PREVIEW_URL=$(curl -s https://api.netlify.com/api/v1/sites/your-netlify-site-id/deploys | jq -r '.[0].ssl_url')
if [ -n "$DEPLOY_PREVIEW_URL" ]; then
echo "Deploy-preview URL is available: $DEPLOY_PREVIEW_URL"
break
else
echo "Waiting for deploy-preview URL..."
sleep 60 # Wait for 60 seconds before checking again
retries=$((retries+1))
fi
done
- name: Set Cypress baseUrl
run: echo "export CYPRESS_BASE_URL=$DEPLOY_PREVIEW_URL" >> $GITHUB_ENV

- name: Cypress run
uses: cypress-io/github-action@v6
with:
config: baseUrl=${{ github.event.inputs.deployPrimeUrl }}
config: baseUrl=${{ env.CYPRESS_BASE_URL }}

0 comments on commit 0aac4c5

Please sign in to comment.