Skip to content

add @devneill to testimonials #1664

add @devneill to testimonials

add @devneill to testimonials #1664

Workflow file for this run

name: 🚀 Deploy
on:
push:
branches:
- main
- dev
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: 🔎 Determine deployable changes
runs-on: ubuntu-latest
outputs:
DEPLOYABLE: ${{steps.changes.outputs.DEPLOYABLE}}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: '50'
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: 🔎 Determine deployable changes
id: changes
run: >-
echo ::set-output name=DEPLOYABLE::$(node ./other/is-deployable.js ${{
github.sha }})
- name: ❓ Deployable
run: >-
echo "DEPLOYABLE: ${{steps.changes.outputs.DEPLOYABLE}}"
lint:
name: ⬣ ESLint
needs: [changes]
if: needs.changes.outputs.DEPLOYABLE == 'true'
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
- name: 🔬 Lint
run: npm run lint
typecheck:
name: ʦ TypeScript
needs: [changes]
if: needs.changes.outputs.DEPLOYABLE == 'true'
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
- name: 🔎 Type check
run: npm run typecheck
jest:
name: 🃏 Jest
needs: [changes]
if: needs.changes.outputs.DEPLOYABLE == 'true'
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
- name: 🃏 Run jest
run: npm run test -- --coverage
# TODO: fix playwright
playwright:
name: 🎭 Playwright
needs: [changes]
if: needs.changes.outputs.DEPLOYABLE == 'true'
runs-on: ubuntu-latest
timeout-minutes: 60
continue-on-error: true
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: 🏄 Copy test env vars
run: cp .env.example .env
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: 🎬 Setup ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: 🌐 Install Playwright Browsers
run: npm run test:e2e:install
- name: 🛠 Setup Database
run: npx prisma migrate reset --force
- name: 🏗 Build
run: npm run build
- name: 🏦 Prime Site Cache
id: site-cache
uses: actions/cache@v3
with:
path: other/cache.db
key: site-cache
- name: 😅 Generate Site Cache
if: steps.site-cache.outputs.cache-hit != 'true'
run: npm run prime-cache:mocks
- name: 🎭 Playwright tests
run: npx playwright test
env:
PORT: 8811
- name: 📊 Upload report
uses: actions/upload-artifact@v2
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
deploy:
name: 🚀 Deploy
runs-on: ubuntu-latest
needs: [changes, lint, typecheck, jest]
# only build/deploy main branch on pushes
if:
${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') &&
github.event_name == 'push' && needs.changes.outputs.DEPLOYABLE == 'true'
}}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
- name: 👀 Read app name
uses: SebRollen/[email protected]
id: app_name
with:
file: 'fly.toml'
field: 'app'
- name: 🚀 Deploy Staging
if: ${{ github.ref == 'refs/heads/dev' }}
uses: superfly/[email protected]
with:
args:
'deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} --app
${{ steps.app_name.outputs.value }}-staging'
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: 🚀 Deploy Production
if: ${{ github.ref == 'refs/heads/main' }}
uses: superfly/[email protected]
with:
args: 'deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }}'
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}