|
14 | 14 | timeout-minutes: 30
|
15 | 15 | runs-on: ubuntu-latest
|
16 | 16 | environment: Production
|
| 17 | + env: |
| 18 | + VERSION: ${{ github.ref_name }} |
17 | 19 | steps:
|
18 | 20 | - name: Checkout to main branch
|
19 | 21 | uses: actions/checkout@v3
|
@@ -42,28 +44,63 @@ jobs:
|
42 | 44 | VITE_PROJECT_NAME: ${{ vars.VITE_PROJECT_NAME }}
|
43 | 45 | VITE_CROWDIN_BRANCH_NAME: ${{ vars.VITE_CROWDIN_BRANCH_NAME }}
|
44 | 46 | VITE_TRANSLATIONS_CDN_URL: ${{ vars.VITE_TRANSLATIONS_CDN_URL }}
|
45 |
| - |
| 47 | + VITE_TRACKJS_TOKEN: ${{ vars.VITE_TRACKJS_TOKEN }} |
| 48 | + VITE_APP_VERSION: ${{ github.ref_name }} |
| 49 | + VITE_GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.VITE_GROWTHBOOK_DECRYPTION_KEY }} |
| 50 | + VITE_GROWTHBOOK_CLIENT_KEY: ${{ vars.VITE_GROWTHBOOK_CLIENT_KEY }} |
| 51 | + VITE_RUDDERSTACK_KEY: ${{ vars.VITE_RUDDERSTACK_KEY }} |
| 52 | + VITE_REMOTE_CONFIG_URL: ${{ vars.VITE_REMOTE_CONFIG_URL }} |
46 | 53 |
|
47 | 54 | - name: Run tests for Eslint
|
48 | 55 | run: npm run test:lint
|
49 | 56 |
|
50 | 57 | - name: Publish to Cloudflare Pages
|
51 | 58 | uses: "deriv-com/shared-actions/.github/actions/publish_to_pages_branch@master"
|
| 59 | + id: publish_to_cloudflare |
52 | 60 | with:
|
53 | 61 | CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
54 | 62 | CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
55 | 63 | project_name: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
|
56 | 64 | branch_name: master
|
57 | 65 | output_dir: dist
|
58 | 66 | cname_url: p2p.deriv.com
|
59 |
| - send_slack_success: |
60 |
| - name: Send Release Slack notification success |
61 |
| - runs-on: ubuntu-latest |
62 |
| - if: success() |
63 |
| - needs: [build_to_cloudflare_pages] |
64 |
| - steps: |
65 |
| - - name: Send Slack Notification |
66 |
| - uses: "deriv-com/shared-actions/.github/actions/send_slack_notification@master" |
67 |
| - with: |
68 |
| - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
69 |
| - MESSAGE: "Production Release succeeded for p2p.deriv.com with version ${{ github.head_ref }}" |
| 67 | + |
| 68 | + - name: Upload to vercel |
| 69 | + uses: 'deriv-com/shared-actions/.github/actions/vercel_DR_publish@master' |
| 70 | + id: dr_action |
| 71 | + with: |
| 72 | + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} |
| 73 | + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} |
| 74 | + VERCEL_TOKEN: ${{ secrets.VERCEL_API_TOKEN }} |
| 75 | + ENVIRONMENT: Production |
| 76 | + VERCEL_SCOPE: deriv |
| 77 | + ALIAS_DOMAIN_URL: 'p2p-dr.binary.sx' |
| 78 | + - name: Send Slack Notification on Vercel Publish failure |
| 79 | + uses: "deriv-com/shared-actions/.github/actions/send_slack_notification@master" |
| 80 | + if: steps.dr_action.conclusion == 'failure' |
| 81 | + with: |
| 82 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 83 | + MESSAGE: "Vercel Publish failed for p2p.deriv.com with version $VERSION" |
| 84 | + |
| 85 | + send_slack_notification: |
| 86 | + name: Send Release Slack notification |
| 87 | + environment: Production |
| 88 | + runs-on: ubuntu-latest |
| 89 | + env: |
| 90 | + VERSION: ${{ github.ref_name }} |
| 91 | + if: always() |
| 92 | + needs: [build_to_cloudflare_pages] |
| 93 | + steps: |
| 94 | + - name: Create Slack Message |
| 95 | + id: create_slack_message |
| 96 | + run: | |
| 97 | + if [[ "${{ needs.build_to_cloudflare_pages.result }}" == 'success' ]]; then |
| 98 | + echo "message=Production Release succeeded for p2p.deriv.com with version $VERSION" >> $GITHUB_OUTPUT |
| 99 | + else |
| 100 | + echo "message=Production Release failed for p2p.deriv.com with version $VERSION" >> $GITHUB_OUTPUT |
| 101 | + fi |
| 102 | + - name: Send Slack Notification |
| 103 | + uses: "deriv-com/shared-actions/.github/actions/send_slack_notification@master" |
| 104 | + with: |
| 105 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 106 | + MESSAGE: ${{ steps.create_slack_message.outputs.message }} |
0 commit comments