Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
fix: incorrect branch name (#5780)
Browse files Browse the repository at this point in the history
  • Loading branch information
balakrishna-deriv authored Oct 16, 2023
1 parent 534018e commit 8575421
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions .github/workflows/generate-preview-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,12 @@ jobs:
directory='public'
projectName='deriv-com-preview-links'
head_branch=${{github.event.workflow_run.head_branch}}
branch=$(echo $head_branch | head -c 20)
branch=$(echo $head_branch | head -c 20 | sed 's/[\/_\.]/-/g; s/[^a-zA-Z0-9]$/1/')
preview_url=$(wrangler pages deploy $directory --project-name=$projectName --branch=$branch > log.txt 2>&1; echo $?)
echo "------"
cat log.txt
branchName=$(echo $branch | sed 's/[\/_\.]/-/g; s/[^a-zA-Z]$//')
if grep -q "Deployment complete" log.txt; then
echo "preview_url=https://$branchName.deriv-com-preview-links.pages.dev" > "$GITHUB_OUTPUT"
echo "preview_url=https://$branch.deriv-com-preview-links.pages.dev" > "$GITHUB_OUTPUT"
else
echo "Deployment to Cloudflare Pages failed."
exit 1
Expand Down Expand Up @@ -185,30 +184,30 @@ jobs:
- name: e2e Smoke Tests
uses: actions/checkout@v4
with:
repository: deriv-com/e2e-deriv-com # Replace with your repository name
repository: deriv-com/e2e-deriv-com # Replace with your repository name

- name: Cypress run
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v6
with:
# Starts web server for E2E tests - replace with your own server invocation
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
# start: npm start
# wait-on: 'http://localhost:3000' # Waits for above
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
record: true
parallel: true # Runs test in parallel using settings above
spec: cypress/e2e/smoke/*.js
group: 'Smoke Tests'
# Starts web server for E2E tests - replace with your own server invocation
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
# start: npm start
# wait-on: 'http://localhost:3000' # Waits for above
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
record: true
parallel: true # Runs test in parallel using settings above
spec: cypress/e2e/smoke/*.js
group: 'Smoke Tests'

env:
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in GitHub repo → Settings → Secrets → Actions
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# Set Base Url from client_payload.
CYPRESS_BASE_URL: ${{steps.publish-to-pages.outputs.preview_url}}
# Send PR and Repo details to Cypress Cloud test run
COMMIT_INFO_MESSAGE: PR "${{steps.pr_information.outputs.issue_number}}" in Repo "${{ github.repository }}"
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in GitHub repo → Settings → Secrets → Actions
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Creating a token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# Set Base Url from client_payload.
CYPRESS_BASE_URL: ${{steps.publish-to-pages.outputs.preview_url}}
# Send PR and Repo details to Cypress Cloud test run
COMMIT_INFO_MESSAGE: PR "${{steps.pr_information.outputs.issue_number}}" in Repo "${{ github.repository }}"

1 comment on commit 8575421

@vercel
Copy link

@vercel vercel bot commented on 8575421 Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-com – ./

deriv-com-git-master.binary.sx
deriv-com.binary.sx

Please sign in to comment.