Skip to content

Commit 85a5da9

Browse files
authored
Merge pull request #17 from duylongpro99/development
reuse the build workflow
2 parents 6016917 + f45da32 commit 85a5da9

File tree

1 file changed

+1
-81
lines changed

1 file changed

+1
-81
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -5,87 +5,7 @@ on:
55
types: [published]
66
jobs:
77
build:
8-
name: "Build Application"
9-
runs-on: ubuntu-latest
10-
11-
steps:
12-
- name: Checkout Code
13-
uses: actions/checkout@v4
14-
15-
- name: Setup Node.js
16-
uses: actions/setup-node@v4
17-
with:
18-
node-version: "20"
19-
20-
- name: Install pnpm
21-
uses: pnpm/action-setup@v2
22-
with:
23-
version: 8
24-
run_install: false
25-
26-
- name: Get pnpm store directory
27-
id: pnpm-cache
28-
shell: bash
29-
run: |
30-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
31-
32-
- name: Setup pnpm cache
33-
uses: actions/cache@v3
34-
with:
35-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
36-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
37-
restore-keys: |
38-
${{ runner.os }}-pnpm-store-
39-
40-
# Install dependencies with fallback logic
41-
- name: Install dependencies
42-
run: |
43-
# Attempt to install with --frozen-lockfile first
44-
if pnpm install --frozen-lockfile; then
45-
echo "Successfully installed dependencies with frozen lockfile"
46-
else
47-
echo "Failed to install with frozen lockfile, attempting normal install"
48-
# Remove potentially incompatible lockfile
49-
rm -f pnpm-lock.yaml
50-
# Run regular install
51-
pnpm install
52-
fi
53-
54-
# Set up environment variables from GitHub secrets
55-
- name: Set up environment variables
56-
run: |
57-
# Create .env file
58-
touch .env
59-
60-
# Add Convex specific variables
61-
echo "NEXT_PUBLIC_CONVEX_URL=${{ secrets.NEXT_PUBLIC_CONVEX_URL }}" >> .env
62-
echo "CONVEX_DEPLOYMENT=${{ secrets.CONVEX_DEPLOYMENT }}" >> .env
63-
64-
# Add other public and private environment variables
65-
echo "CLERK_SECRET_KEY=${{ secrets.CLERK_SECRET_KEY }}" >> .env
66-
echo "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}" >> .env
67-
68-
# Liveblocks secret key:
69-
echo "LIVE_BLOCK_SECRET_API_KEY=${{secrets.LIVE_BLOCK_SECRET_API_KEY}}" >> .env
70-
71-
- name: Build
72-
run: pnpm build
73-
env:
74-
NEXT_PUBLIC_CONVEX_URL: ${{ secrets.NEXT_PUBLIC_CONVEX_URL }}
75-
76-
# Upload the build artifacts to be used by the deploy job
77-
- name: Upload build artifacts
78-
uses: actions/upload-artifact@v4
79-
with:
80-
name: build-output
81-
path: |
82-
.next
83-
public
84-
package.json
85-
pnpm-lock.yaml
86-
next.config.js
87-
.env
88-
8+
uses: './build.yml'
899
deploy:
9010
name: Deploy Application to Vercel
9111
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)