Skip to content

Commit

Permalink
Merge branch 'main' into 616-diff-style
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra authored Dec 21, 2024
2 parents dd119a6 + 413a379 commit 353d080
Show file tree
Hide file tree
Showing 53 changed files with 13,026 additions and 9,449 deletions.
6 changes: 3 additions & 3 deletions .github/actions/pnpm-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ runs:
using: 'composite'

steps:
- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9.5.0

- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
id: pnpm-config
Expand All @@ -21,7 +21,7 @@ runs:
run: |
echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
Expand Down
11 changes: 11 additions & 0 deletions .github/actions/setup-job/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Setup CI Step'
description: 'Checkout PR and use same node version for jobs'

runs:
using: 'composite'

steps:
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
163 changes: 57 additions & 106 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v3
# with:
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

Expand Down Expand Up @@ -59,16 +55,11 @@ jobs:
name: Lint
needs: install
runs-on: ubuntu-latest

steps:
- name: Checkout PR
uses: actions/checkout@v3
# with:
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

Expand All @@ -85,15 +76,11 @@ jobs:
name: Build packages
needs: [ install ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# with:
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Checkout PR
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

Expand All @@ -108,7 +95,7 @@ jobs:
pnpm libs:build
- name: Cache packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: packages
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}
Expand All @@ -119,13 +106,10 @@ jobs:
needs: [ install, build-packages ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# with:
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Checkout PR
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

Expand All @@ -136,7 +120,7 @@ jobs:
pnpm --filter=@codeimage/prisma-models build
- name: Restore dist
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: packages
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}
Expand All @@ -156,21 +140,16 @@ jobs:
needs: [ build-packages ]
if: ${{ github.head_ref != 'next' }}
runs-on: ubuntu-latest

steps:
- name: Checkout PR
uses: actions/checkout@v3
# with:
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: Restore dist
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: packages
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}
Expand All @@ -190,7 +169,7 @@ jobs:
run: |
pnpm --filter=@codeimage/app build
- uses: amondnet/vercel-action@v25.1.0
- uses: amondnet/vercel-action@v25.2.0
with:
vercel-token: ${{secrets.VERCEL_TOKEN}} # Required
github-token: ${{secrets.GITHUB_TOKEN}} #Optional
Expand All @@ -208,22 +187,16 @@ jobs:
needs: [ build-packages ]
if: ${{ github.head_ref == 'next' }}
runs-on: ubuntu-latest

steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
ref: 'refs/pull/${{ github.event.number }}/merge'
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: Restore dist
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: packages
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}
Expand All @@ -243,7 +216,7 @@ jobs:
run: |
pnpm --filter=@codeimage/app build
- uses: amondnet/vercel-action@v25.1.0
- uses: amondnet/vercel-action@v25.2.0
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
github-token: ${{ secrets.GITHUB_TOKEN }} #Optional
Expand All @@ -261,22 +234,16 @@ jobs:
needs: [ build-packages ]
if: (${{ needs.install.outputs.app-change == 'true' }} || ${{ needs.install.outputs.libs-change == 'true' }})
runs-on: ubuntu-latest

steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
submodules: 'true'
# ref: 'refs/pull/${{ github.event.number }}/merge'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: Restore dist
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: packages
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}
Expand All @@ -287,7 +254,7 @@ jobs:
run: |
pnpm --filter=@codeimage/highlight build:dev
- uses: amondnet/vercel-action@v25.1.0
- uses: amondnet/vercel-action@v25.2.0
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
github-token: ${{ secrets.GITHUB_TOKEN }} #Optional
Expand All @@ -304,22 +271,16 @@ jobs:
needs: [ build-packages ]
if: (${{ needs.install.outputs.app-change == 'true' }} || ${{ needs.install.outputs.libs-change == 'true' }})
runs-on: ubuntu-latest

steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
ref: 'refs/pull/${{ github.event.number }}/merge'
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: Restore dist
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: packages
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}
Expand All @@ -334,7 +295,7 @@ jobs:
run: |
pnpm --filter=@codeimage/website build
- uses: amondnet/vercel-action@v25.1.0
- uses: amondnet/vercel-action@v25.2.0
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
github-token: ${{ secrets.GITHUB_TOKEN }} #Optional
Expand All @@ -346,7 +307,7 @@ jobs:
codeimage-website-pr-{{PR_NUMBER}}.vercel.app
- name: Cache website
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: apps/website
key: apps-website-${{ github.run_id }}-${{ github.run_number }}
Expand All @@ -357,19 +318,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
ref: 'refs/pull/${{ github.event.number }}/merge'
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: Restore website
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: apps/website
key: apps-website-${{ github.run_id }}-${{ github.run_number }}
Expand All @@ -387,13 +343,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# with:
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Checkout PR
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

Expand All @@ -408,7 +361,7 @@ jobs:
pnpm prepare:api:deploy
- name: Cache build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
dist/api-bundle/**
Expand Down Expand Up @@ -449,14 +402,15 @@ jobs:
ALLOWED_ORIGINS: '*'

steps:
- uses: actions/checkout@v3
# with:
# submodules: 'true'
- name: Checkout PR
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: Restore dist
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
packages
Expand Down Expand Up @@ -488,24 +442,21 @@ jobs:
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# with:
# submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Checkout PR
uses: actions/checkout@v4
- name: 📥 Setup
uses: ./.github/actions/setup-job
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: Restore packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: packages
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}

- name: Restore api build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
dist/api-bundle/**
Expand Down
Loading

0 comments on commit 353d080

Please sign in to comment.