fix(deps): update all non-major dependencies #890
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: 🚀 CI | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: {} | |
permissions: | |
actions: write | |
contents: read | |
jobs: | |
lint: | |
name: ⬣ ESLint | |
runs-on: ubuntu-latest | |
# env: | |
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4.0.0 | |
- name: ⎔ Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: 📥 Download deps | |
run: pnpm install --ignore-scripts | |
- name: 🔬 Lint | |
run: npm run lint | |
typecheck: | |
name: ʦ TypeScript | |
runs-on: ubuntu-latest | |
# env: | |
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4.0.0 | |
- name: ⎔ Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: 📥 Download deps | |
run: pnpm install --ignore-scripts | |
- name: 🛠 Setup PrismaClient | |
run: pnpm generate | |
- name: ⚙️ Build | |
run: pnpm build | |
- name: 🔎 Type check | |
run: pnpm typecheck | |
vitest: | |
name: ⚡ Vitest | |
runs-on: ubuntu-latest | |
# env: | |
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
- name: 🏄 Copy test env vars | |
run: cp .env.example .env | |
- name: 🏄 Copy test env vars to Package | |
run: cp .env.example packages/database/.env | |
- uses: pnpm/action-setup@v4.0.0 | |
- name: ⎔ Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: 📥 Download deps | |
run: pnpm install --ignore-scripts | |
- name: 🛠 Setup PrismaClient | |
run: npm run generate | |
- name: ⚡ Run vitest | |
run: npm run test | |
playwright: | |
name: 🎭 Playwright | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4.0.0 | |
- name: ⎔ Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: 🏄 Copy test env vars | |
run: cp .env.example .env | |
- name: 🏄 Copy test env vars to Package | |
run: cp .env.example packages/database/.env | |
- name: 📥 Download deps | |
run: pnpm install | |
- name: 🐳 Docker compose | |
# the sleep is just there to give time for postgres to get started | |
run: docker compose -f docker-compose-ci.yml up -d && sleep 3 | |
env: | |
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/postgres" | |
- name: 🛠 Setup Database | |
run: pnpm run db:migrate:force | |
- name: ⚙️ Build | |
run: pnpm run build | |
- name: Install Playwright Browsers and run tests | |
run: pnpm test:e2e:ci | |
- name: Upload Report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: apps/remix-app/playwright-report/ | |
retention-days: 30 | |
# build: | |
# name: 🐳 Build | |
# # only build/deploy main branch on pushes | |
# if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: 🛑 Cancel Previous Runs | |
# uses: styfle/cancel-workflow-action@0.12.1 | |
# - name: ⬇️ Checkout repo | |
# uses: actions/checkout@v4 | |
# - name: 👀 Read app name | |
# uses: SebRollen/toml-action@v1.2.0 | |
# id: app_name | |
# with: | |
# file: "apps/remix-app/fly.toml" | |
# field: "app" | |
# - name: 🐳 Set up Docker Buildx | |
# uses: docker/setup-buildx-action@v3 | |
# with: | |
# version: v0.9.1 | |
# # Setup cache | |
# - name: ⚡️ Cache Docker layers | |
# uses: actions/cache@v4 | |
# with: | |
# path: /tmp/.buildx-cache | |
# key: ${{ runner.os }}-buildx-${{ github.sha }} | |
# restore-keys: | | |
# ${{ runner.os }}-buildx- | |
# - name: 🔑 Fly Registry Auth | |
# uses: docker/login-action@v3 | |
# with: | |
# registry: registry.fly.io | |
# username: x | |
# password: ${{ secrets.FLY_API_TOKEN }} | |
# - name: 🐳 Docker build | |
# uses: docker/build-push-action@v5 | |
# with: | |
# context: . | |
# file: apps/remix-app/Dockerfile | |
# push: true | |
# tags: registry.fly.io/${{ steps.app_name.outputs.value }}:${{ github.ref_name }}-${{ github.sha }} | |
# build-args: | | |
# COMMIT_SHA=${{ github.sha }} | |
# cache-from: type=local,src=/tmp/.buildx-cache | |
# cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new | |
# # This ugly bit is necessary if you don't want your cache to grow forever | |
# # till it hits GitHub's limit of 5GB. | |
# # Temp fix | |
# # https://github.com/docker/build-push-action/issues/252 | |
# # https://github.com/moby/buildkit/issues/1896 | |
# - name: 🚚 Move cache | |
# run: | | |
# rm -rf /tmp/.buildx-cache | |
# mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
deploy: | |
name: 🚀 Deploy | |
runs-on: ubuntu-latest | |
needs: [lint, typecheck, vitest, playwright] | |
# only build/deploy main branch on pushes | |
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
- name: 👀 Read app name | |
uses: SebRollen/toml-action@v1.2.0 | |
id: app_name | |
with: | |
file: "apps/remix-app/fly.toml" | |
field: "app" | |
- name: 🎈 Setup Fly | |
uses: superfly/flyctl-actions/setup-flyctl@1.5 | |
- name: 🚀 Deploy Staging | |
if: ${{ github.ref == 'refs/heads/dev' }} | |
run: | |
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | |
--app ${{ steps.app_name.outputs.value }}-staging | |
--config ./apps/remix-app/fly.toml | |
--dockerfile ./apps/remix-app/Dockerfile | |
--ignorefile ./apps/remix-app/.dockerignore | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
- name: 🚀 Deploy Production | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | |
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | |
--app ${{ steps.app_name.outputs.value }} | |
--config ./apps/remix-app/fly.toml | |
--dockerfile ./apps/remix-app/Dockerfile | |
--ignorefile ./apps/remix-app/.dockerignore | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |