Skip to content

Commit

Permalink
Merge branch 'main' of github.com:deriv-com/bot into shafin/BOT-1711/…
Browse files Browse the repository at this point in the history
…chore--bot-seperate-package-1
  • Loading branch information
shafin-deriv committed Jun 5, 2024
2 parents 1be196a + 42e5153 commit 8ef1145
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
timeout-minutes: 30
runs-on: ubuntu-latest
environment: staging
permissions:
checks: write
pull-requests: write
steps:
- name: Verify user
uses: 'deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1'
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
build_to_cloudflare_pages:
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Verify user
uses: 'deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1'
Expand Down Expand Up @@ -107,18 +104,18 @@ jobs:
id: publish-to-pages
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_TEST_LINK_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_TEST_LINK_ACCOUNT_ID }}
CLOUDFLARE_PROJECT_NAME: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
HEAD_BRANCH: ${{ github.head_ref }}
run: |
echo "Installing Wrangler CLI"
npm i -g wrangler
echo "Deploying build to Cloudflare Pages"
directory='public'
projectName=${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory='dist/'
branch=$(echo "$HEAD_BRANCH" | head -c 20 | sed 's/[\/_\.]/-/g; s/[^a-zA-Z0-9]$/1/')
cf_preview_url=$(wrangler pages deploy $directory --project-name=$projectName --branch=$branch > log.txt 2>&1; echo $?)
cf_preview_url=$(wrangler pages deploy $directory --project-name=$CLOUDFLARE_PROJECT_NAME --branch=$branch > log.txt 2>&1; echo $?)
echo "------"
preview_url=https://$branch.$projectName.pages.dev
preview_url=https://$branch.$CLOUDFLARE_PROJECT_NAME.pages.dev
cat log.txt
if grep -q "Deployment complete" log.txt; then
echo "preview_url=$preview_url" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 8ef1145

Please sign in to comment.