feat(usage): break usage down by request type or SDK (#8343) #2209
This file contains hidden or 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: Frontend Deploy to Production | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - frontend/** | |
| - .github/** | |
| jobs: | |
| run-unit-tests: | |
| runs-on: ubuntu-latest | |
| name: Run Unit Tests | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - name: Cloning repo | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: frontend/.nvmrc | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| run: npm run test:unit -- --passWithNoTests | |
| run-tests: | |
| needs: run-unit-tests | |
| runs-on: depot-ubuntu-latest | |
| name: Run E2E Tests | |
| environment: production | |
| concurrency: | |
| group: e2e-tests-prod | |
| cancel-in-progress: true | |
| steps: | |
| - name: Cloning repo | |
| uses: actions/checkout@v5 | |
| # Temporarily install Firefox 143.0 to avoid test failures as superior versions cause frontend e2e tests to hang | |
| # To be removed once upstream issue correctly resolved | |
| - name: Install Firefox 143.0 | |
| run: | | |
| sudo apt-get remove -y firefox || true | |
| sudo rm -rf /usr/bin/firefox /usr/lib/firefox* | |
| ARCH=$(uname -m) | |
| wget -O /tmp/firefox.tar.xz "https://ftp.mozilla.org/pub/firefox/releases/143.0/linux-${ARCH}/en-US/firefox-143.0.tar.xz" | |
| sudo tar -xJf /tmp/firefox.tar.xz -C /opt | |
| sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox | |
| rm /tmp/firefox.tar.xz | |
| firefox --version | |
| - name: Run E2E tests against production | |
| uses: ./.github/actions/e2e-tests | |
| with: | |
| e2e_test_token: ${{ secrets.E2E_TEST_TOKEN }} | |
| slack_token: ${{ secrets.SLACK_TOKEN }} | |
| environment: prod | |
| tests: --grep "@oss|@enterprise|@saas" | |
| deploy-production: | |
| name: Deploy to Vercel Production | |
| needs: run-tests | |
| uses: ./.github/workflows/.reusable-frontend-deploy.yml | |
| with: | |
| gh_environment: production | |
| npm_build_environment: prod | |
| secrets: inherit | |
| notify-production-smoke-test: | |
| name: Notify Production Smoke Test | |
| needs: deploy-production | |
| if: ${{ needs.deploy-production.result == 'success' }} | |
| runs-on: ubuntu-latest | |
| # Only needs to read the repo to resolve the local action below. | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Cloning repo | |
| uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 | |
| with: | |
| # Nothing runs git after this, so the token need not persist. | |
| persist-credentials: false | |
| - name: Notify Slack | |
| # The deploy has already succeeded by this point, so a Slack outage or a | |
| # rotated webhook should not fail the run. | |
| continue-on-error: true | |
| uses: ./.github/actions/notify-slack-deploy | |
| with: | |
| webhook_url: ${{ secrets.SLACK_FRONTEND_DEPLOY_WEBHOOK }} | |
| service: Frontend | |
| app_url: https://app.flagsmith.com | |
| deploy-demo: | |
| name: Deploy to Vercel Demo | |
| needs: run-tests | |
| uses: ./.github/workflows/.reusable-frontend-deploy.yml | |
| with: | |
| gh_environment: demo | |
| npm_build_environment: prod | |
| secrets: inherit | |
| deploy-demo2: | |
| name: Deploy to Vercel Demo2 | |
| needs: run-tests | |
| uses: ./.github/workflows/.reusable-frontend-deploy.yml | |
| with: | |
| gh_environment: demo2 | |
| npm_build_environment: prod | |
| secrets: inherit |