Skip to content

Merge pull request #136 from deriv-com/ako/add-code-owners #125

Merge pull request #136 from deriv-com/ako/add-code-owners

Merge pull request #136 from deriv-com/ako/add-code-owners #125

name: Build staging and Deploy to Cloudflare Pages
on:
push:
branches:
- 'main'
concurrency:
group: cloudflare-pages-build-staging
cancel-in-progress: true
jobs:
build_to_cloudflare_pages:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout to main branch
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install dependencies
run: npm ci
shell: bash
- name: Build staging
run: npm run build
env:
VITE_RUDDERSTACK_KEY: ${{ secrets.VITE_RUDDERSTACK_KEY }}
- name: Run tests for Eslint
run: npm run test:lint
- name: Run unit tests and coverage report
run: npm run test
- name: Publish to CF pages branch
id: publish_to_pages_branch
uses: "deriv-com/shared-actions/.github/actions/publish_to_pages_branch@v1"
with:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
project_name: "traders-hub"
branch_name: staging
output_dir: dist
env:
VITE_RUDDERSTACK_KEY: ${{ secrets.VITE_RUDDERSTACK_KEY }}