Merge pull request #135 from shahzaib-deriv/ci/update-packages #126
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |