Skip to content

Commit 1217c5b

Browse files
committed
modify .github/workflows/deploy.yml
1 parent faeb72d commit 1217c5b

File tree

1 file changed

+169
-109
lines changed

1 file changed

+169
-109
lines changed

.github/workflows/deploy.yml

Lines changed: 169 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,54 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy site
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: [main]
66
workflow_dispatch:
77

8+
jobs:
9+
ci:
10+
uses: ./.github/workflows/_setup.yml
11+
12+
build-page:
13+
runs-on: ubuntu-latest
14+
needs: ci
15+
steps:
16+
- uses: actions/checkout@v4
17+
- id: yarn-cache-dir-path
18+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
19+
- uses: actions/configure-pages@v5
20+
with:
21+
static_site_generator: next
22+
- uses: actions/cache@v4
23+
with:
24+
path: |
25+
${{ github.workspace }}/node_modules
26+
${{ steps.yarn-cache-dir-path.outputs.dir }}
27+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-nodemodules
28+
- name: build
29+
run: yarn build
30+
env:
31+
NODE_ENV: production
32+
NEXT_PUBLIC_AIRTABLE_PAT: ${{ secrets.NEXT_PUBLIC_AIRTABLE_PAT }}
33+
NEXT_PUBLIC_AIRTABLE_BASE: ${{ secrets.NEXT_PUBLIC_AIRTABLE_BASE }}
34+
NEXT_PUBLIC_AIRTABLE_TABLE: ${{ secrets.NEXT_PUBLIC_AIRTABLE_TABLE }}
35+
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: ./out
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build-page
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4
51+
852
permissions:
953
contents: read
1054
pages: write
@@ -14,130 +58,146 @@ concurrency:
1458
group: "pages"
1559
cancel-in-progress: false
1660

17-
jobs:
18-
build:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v4
61+
# name: Deploy to GitHub Pages
62+
63+
# on:
64+
# push:
65+
# branches: [ "main" ]
66+
# workflow_dispatch:
67+
68+
# permissions:
69+
# contents: read
70+
# pages: write
71+
# id-token: write
72+
73+
# concurrency:
74+
# group: "pages"
75+
# cancel-in-progress: false
76+
77+
# jobs:
78+
# build:
79+
# runs-on: ubuntu-latest
80+
# steps:
81+
# - name: Checkout
82+
# uses: actions/checkout@v4
2383

24-
- name: Setup Node.js
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: '18'
28-
cache: 'yarn'
84+
# - name: Setup Node.js
85+
# uses: actions/setup-node@v4
86+
# with:
87+
# node-version: '18'
88+
# cache: 'yarn'
2989

30-
- name: Setup Pages
31-
uses: actions/configure-pages@v4
32-
with:
33-
static_site_generator: next
90+
# - name: Setup Pages
91+
# uses: actions/configure-pages@v4
92+
# with:
93+
# static_site_generator: next
3494

35-
- name: Restore cache
36-
uses: actions/cache@v4
37-
with:
38-
path: |
39-
.next/cache
40-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
41-
restore-keys: |
42-
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
95+
# - name: Restore cache
96+
# uses: actions/cache@v4
97+
# with:
98+
# path: |
99+
# .next/cache
100+
# key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
101+
# restore-keys: |
102+
# ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
43103

44-
- name: Install dependencies
45-
run: yarn install --frozen-lockfile
104+
# - name: Install dependencies
105+
# run: yarn install --frozen-lockfile
46106

47-
- name: Build with Next.js
48-
run: |
49-
echo "Starting Next.js build process..."
50-
echo "Checking for config file conflicts..."
51-
ls -la next.config.*
107+
# - name: Build with Next.js
108+
# run: |
109+
# echo "Starting Next.js build process..."
110+
# echo "Checking for config file conflicts..."
111+
# ls -la next.config.*
52112

53-
# Remove any conflicting next.config.js if it exists
54-
if [ -f "next.config.js" ]; then
55-
echo "Removing conflicting next.config.js"
56-
rm next.config.js
57-
fi
113+
# # Remove any conflicting next.config.js if it exists
114+
# if [ -f "next.config.js" ]; then
115+
# echo "Removing conflicting next.config.js"
116+
# rm next.config.js
117+
# fi
58118

59-
echo "Current next.config.ts content:"
60-
cat next.config.ts
119+
# echo "Current next.config.ts content:"
120+
# cat next.config.ts
61121

62-
echo "Running yarn build..."
63-
yarn build
122+
# echo "Running yarn build..."
123+
# yarn build
64124

65-
echo "Build completed. Checking output directory..."
66-
if [ -d "./out" ]; then
67-
echo "✅ out directory exists"
68-
ls -la ./out/
69-
else
70-
echo "❌ out directory not found"
71-
echo "Available directories:"
72-
ls -la ./
73-
echo "Checking .next directory:"
74-
ls -la .next/ 2>/dev/null || echo "No .next directory"
125+
# echo "Build completed. Checking output directory..."
126+
# if [ -d "./out" ]; then
127+
# echo "✅ out directory exists"
128+
# ls -la ./out/
129+
# else
130+
# echo "❌ out directory not found"
131+
# echo "Available directories:"
132+
# ls -la ./
133+
# echo "Checking .next directory:"
134+
# ls -la .next/ 2>/dev/null || echo "No .next directory"
75135

76-
echo "Trying manual static export..."
77-
rm -rf .next out
78-
NODE_ENV=production yarn next build
136+
# echo "Trying manual static export..."
137+
# rm -rf .next out
138+
# NODE_ENV=production yarn next build
79139

80-
echo "After rebuild, checking directories:"
81-
ls -la ./
140+
# echo "After rebuild, checking directories:"
141+
# ls -la ./
82142

83-
if [ ! -d "./out" ]; then
84-
echo "Static export still failed. Checking Next.js export structure..."
85-
echo "Searching for static files in .next:"
86-
find .next -name "*.html" -type f || echo "No HTML files found"
143+
# if [ ! -d "./out" ]; then
144+
# echo "Static export still failed. Checking Next.js export structure..."
145+
# echo "Searching for static files in .next:"
146+
# find .next -name "*.html" -type f || echo "No HTML files found"
87147

88-
echo "Manual export attempt..."
89-
mkdir -p out
148+
# echo "Manual export attempt..."
149+
# mkdir -p out
90150

91-
# Copy static assets
92-
if [ -d ".next/static" ]; then
93-
echo "Copying .next/static to out/_next/static"
94-
mkdir -p out/_next
95-
cp -r .next/static out/_next/
96-
fi
151+
# # Copy static assets
152+
# if [ -d ".next/static" ]; then
153+
# echo "Copying .next/static to out/_next/static"
154+
# mkdir -p out/_next
155+
# cp -r .next/static out/_next/
156+
# fi
97157

98-
# Copy server-generated pages
99-
if [ -d ".next/server/pages" ]; then
100-
echo "Copying server pages"
101-
find .next/server/pages -name "*.html" -exec cp {} out/ \;
102-
fi
158+
# # Copy server-generated pages
159+
# if [ -d ".next/server/pages" ]; then
160+
# echo "Copying server pages"
161+
# find .next/server/pages -name "*.html" -exec cp {} out/ \;
162+
# fi
103163

104-
# Copy standalone pages if they exist
105-
if [ -d ".next/standalone" ]; then
106-
echo "Copying standalone files"
107-
cp -r .next/standalone/* out/ 2>/dev/null || echo "No standalone files"
108-
fi
164+
# # Copy standalone pages if they exist
165+
# if [ -d ".next/standalone" ]; then
166+
# echo "Copying standalone files"
167+
# cp -r .next/standalone/* out/ 2>/dev/null || echo "No standalone files"
168+
# fi
109169

110-
echo "Final out directory contents:"
111-
ls -la ./out/
112-
fi
113-
fi
114-
env:
115-
NEXT_PUBLIC_AIRTABLE_PAT: ${{ secrets.NEXT_PUBLIC_AIRTABLE_PAT }}
116-
NEXT_PUBLIC_AIRTABLE_BASE: ${{ secrets.NEXT_PUBLIC_AIRTABLE_BASE }}
117-
NEXT_PUBLIC_AIRTABLE_TABLE: ${{ secrets.NEXT_PUBLIC_AIRTABLE_TABLE }}
170+
# echo "Final out directory contents:"
171+
# ls -la ./out/
172+
# fi
173+
# fi
174+
# env:
175+
# NEXT_PUBLIC_AIRTABLE_PAT: ${{ secrets.NEXT_PUBLIC_AIRTABLE_PAT }}
176+
# NEXT_PUBLIC_AIRTABLE_BASE: ${{ secrets.NEXT_PUBLIC_AIRTABLE_BASE }}
177+
# NEXT_PUBLIC_AIRTABLE_TABLE: ${{ secrets.NEXT_PUBLIC_AIRTABLE_TABLE }}
118178

119-
- name: Check if out directory exists before upload
120-
run: |
121-
if [ ! -d "./out" ]; then
122-
echo "❌ Error: out directory does not exist"
123-
echo "Current directory contents:"
124-
ls -la ./
125-
exit 1
126-
fi
127-
echo "✅ out directory confirmed, proceeding with upload"
179+
# - name: Check if out directory exists before upload
180+
# run: |
181+
# if [ ! -d "./out" ]; then
182+
# echo "❌ Error: out directory does not exist"
183+
# echo "Current directory contents:"
184+
# ls -la ./
185+
# exit 1
186+
# fi
187+
# echo "✅ out directory confirmed, proceeding with upload"
128188

129-
- name: Upload artifact
130-
uses: actions/upload-pages-artifact@v3
131-
with:
132-
path: ./out
189+
# - name: Upload artifact
190+
# uses: actions/upload-pages-artifact@v3
191+
# with:
192+
# path: ./out
133193

134-
deploy:
135-
environment:
136-
name: github-pages
137-
url: ${{ steps.deployment.outputs.page_url }}
138-
runs-on: ubuntu-latest
139-
needs: build
140-
steps:
141-
- name: Deploy to GitHub Pages
142-
id: deployment
143-
uses: actions/deploy-pages@v4
194+
# deploy:
195+
# environment:
196+
# name: github-pages
197+
# url: ${{ steps.deployment.outputs.page_url }}
198+
# runs-on: ubuntu-latest
199+
# needs: build
200+
# steps:
201+
# - name: Deploy to GitHub Pages
202+
# id: deployment
203+
# uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)