feat(serializer): support line breaks and links (#45) #32
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 | |
on: | |
push: | |
branches: | |
- main | |
env: | |
CI: 'true' | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Start docker compose | |
run: npm run docker:up | |
- name: Install deps | |
uses: bahmutov/npm-install@v1 | |
- name: Run unit tests | |
run: npm test | |
lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install deps | |
uses: bahmutov/npm-install@v1 | |
- name: Lint code | |
run: npm run lint | |
typecheck: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install deps | |
uses: bahmutov/npm-install@v1 | |
- name: Transpile TypeScript | |
run: npm run typecheck | |
deploy-app-staging: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: | |
- unit-tests | |
- lint | |
- typecheck | |
environment: | |
name: app-staging | |
url: https://nots-app-staging.vercel.app/ | |
env: | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install deps | |
uses: bahmutov/npm-install@v1 | |
- name: Build app | |
run: npx vercel build --yes --local-config vercel-app.json --prod --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Migrate database | |
run: npx drizzle-kit migrate | |
- name: Deploy to Vercel | |
run: npx vercel deploy --prebuilt --local-config vercel-app.json --yes --prod --token=${{ secrets.VERCEL_TOKEN }} | |
e2e: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: | |
- deploy-app-staging | |
env: | |
BASE_URL: https://nots-app-staging.vercel.app/ | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install deps | |
uses: bahmutov/npm-install@v1 | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(npx playwright --version)" >> $GITHUB_ENV | |
- name: Cache playwright binaries | |
uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- name: Run e2e tests | |
run: npm run e2e:ci | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-results | |
path: test-results/ | |
deploy-app-prod: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: | |
- e2e | |
environment: | |
name: app-prod | |
url: https://nots-app-prod.vercel.app/ | |
env: | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install deps | |
uses: bahmutov/npm-install@v1 | |
- name: Build app | |
run: npx vercel build --yes --local-config vercel-app.json --prod --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Migrate database | |
run: npx drizzle-kit migrate | |
- name: Deploy to Vercel | |
run: npx vercel deploy --yes --local-config vercel-app.json --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} | |
deploy-ui-prod: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: | |
- e2e | |
environment: | |
name: ui-prod | |
url: https://nots-ui-prod.vercel.app/ | |
env: | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install deps | |
uses: bahmutov/npm-install@v1 | |
- name: Build UI | |
run: npx vercel build --prod --yes --local-config vercel-ui.json --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy to Vercel | |
run: npx vercel deploy --prebuilt --yes --prod --local-config vercel-ui.json --token=${{ secrets.VERCEL_TOKEN }} |