Merge pull request #3168 from amitsingh-007/b-fix-tabs-open-on-osx #315
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: Deploy CI | |
on: | |
push: | |
branches: | |
- 'main' | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
outputs: | |
preview_url: ${{ steps.vercel-action.outputs.preview-url }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9 | |
- name: Setting up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Building Extension | |
run: pnpm build --filter=@bypass/extension | |
- name: Uploading extension | |
uses: actions/upload-artifact@v4 | |
with: | |
name: extension-folder | |
path: ./apps/extension/build | |
- name: Deploy Preview (Vercel) | |
uses: amondnet/vercel-action@v25 | |
id: vercel-action | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} | |
github-comment: false | |
Playwright: | |
needs: [Build] | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9 | |
- name: Setting up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Cache Playwright binaries | |
uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
path: | | |
~/Library/Caches/ms-playwright | |
~/.cache/ms-playwright | |
${{ github.workspace }}/node_modules/playwright | |
key: cache-playwright-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: cache-playwright- | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: extension-folder | |
path: ./apps/extension/build | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Playwright browsers | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
run: npx playwright install --with-deps | |
- name: Run Playwright tests | |
run: xvfb-run --auto-servernum -- npx playwright test | |
env: | |
PLAYWRIGHT_TEST_BASE_URL: ${{ needs.Build.outputs.preview_url }} | |
- name: Upload Playwright test report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
Deploy: | |
runs-on: ubuntu-latest | |
needs: [Playwright] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Start deployment | |
uses: bobheadxi/deployments@v1.5.0 | |
id: deployment | |
with: | |
step: start | |
token: ${{ secrets.GITHUB_TOKEN }} | |
env: Production | |
- name: Deploy (Vercel) | |
uses: amondnet/vercel-action@v25 | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} | |
vercel-args: '--prod' | |
- name: Finish deployment | |
uses: bobheadxi/deployments@v1.5.0 | |
if: always() | |
with: | |
step: finish | |
token: ${{ secrets.GITHUB_TOKEN }} | |
status: ${{ job.status }} | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
env_url: ${{ steps.vercel-action.outputs.preview-url }} | |
env: ${{ steps.deployment.outputs.env }} | |
Create_Release: | |
runs-on: ubuntu-latest | |
needs: [Deploy] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: extension-folder | |
path: ./apps/extension/build/ | |
- name: Generate Release Tag | |
id: release_tag | |
uses: amitsingh-007/next-release-tag@v6.0.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tag_prefix: 'v' | |
tag_template: 'yy.mm.i' | |
- name: Get Release Asset Name | |
id: asset_name | |
run: | | |
file=$(find ./apps/extension/build/bypass-links-*.zip -printf "%f\n") | |
echo "asset_name=$file" >> $GITHUB_OUTPUT | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Release ${{ steps.release_tag.outputs.next_release_tag }} | |
tag_name: ${{ steps.release_tag.outputs.next_release_tag }} | |
token: ${{secrets.GITHUB_TOKEN}} | |
generate_release_notes: true | |
files: ./apps/extension/build/${{ steps.asset_name.outputs.asset_name }} |