Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 39 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v4
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v4

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
Expand Down Expand Up @@ -75,10 +75,10 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v4
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v4

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
Expand Down Expand Up @@ -129,35 +129,47 @@ jobs:
environment:
name: preview
url: ${{ steps.deploy.outputs.url }}
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
steps:
- name: Skip deploy when Vercel token is unavailable
if: env.VERCEL_TOKEN == ''
run: echo "VERCEL_TOKEN is unavailable in this workflow context; skipping preview deployment."

- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
if: env.VERCEL_TOKEN != ''
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v4
if: env.VERCEL_TOKEN != ''
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v4

- name: Setup Node.js
if: env.VERCEL_TOKEN != ''
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '22'
cache: 'pnpm'

- name: Pull Vercel Environment
run: pnpm dlx vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
if: env.VERCEL_TOKEN != ''
run: pnpm dlx vercel pull --yes --environment=preview --token="$VERCEL_TOKEN"

- name: Build Project
run: pnpm dlx vercel build --token=${{ secrets.VERCEL_TOKEN }}
if: env.VERCEL_TOKEN != ''
run: pnpm dlx vercel build --token="$VERCEL_TOKEN"
env:
GITHUB_PAT: ${{ secrets.GH_PAT }}

- name: Deploy Preview
id: deploy
if: env.VERCEL_TOKEN != ''
run: |
url=$(pnpm dlx vercel deploy --prebuilt --archive=tgz --token=${{ secrets.VERCEL_TOKEN }})
url=$(pnpm dlx vercel deploy --prebuilt --archive=tgz --token="$VERCEL_TOKEN")
echo "url=$url" >> $GITHUB_OUTPUT

- name: Comment PR
if: ${{ !github.event.pull_request.head.repo.fork }}
if: ${{ !github.event.pull_request.head.repo.fork && env.VERCEL_TOKEN != '' }}
continue-on-error: true
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
Expand Down Expand Up @@ -190,26 +202,38 @@ jobs:
environment:
name: production
url: https://wcpos.com
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
steps:
- name: Skip deploy when Vercel token is unavailable
if: env.VERCEL_TOKEN == ''
run: echo "VERCEL_TOKEN is unavailable in this workflow context; skipping production deployment."

- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
if: env.VERCEL_TOKEN != ''
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v4
if: env.VERCEL_TOKEN != ''
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v4

- name: Setup Node.js
if: env.VERCEL_TOKEN != ''
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '22'
cache: 'pnpm'

- name: Pull Vercel Environment
run: pnpm dlx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
if: env.VERCEL_TOKEN != ''
run: pnpm dlx vercel pull --yes --environment=production --token="$VERCEL_TOKEN"

- name: Build Project
run: pnpm dlx vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
if: env.VERCEL_TOKEN != ''
run: pnpm dlx vercel build --prod --token="$VERCEL_TOKEN"
env:
GITHUB_PAT: ${{ secrets.GH_PAT }}

- name: Deploy Production
run: pnpm dlx vercel deploy --prebuilt --prod --archive=tgz --token=${{ secrets.VERCEL_TOKEN }}
if: env.VERCEL_TOKEN != ''
run: pnpm dlx vercel deploy --prebuilt --prod --archive=tgz --token="$VERCEL_TOKEN"
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Dependency Review
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v4
Expand Down
Loading