1- name : Deploy site
1+ name : Deploy to GitHub Pages
22
33on :
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-
528permissions :
539 contents : read
5410 pages : write
@@ -58,146 +14,130 @@ concurrency:
5814 group : " pages"
5915 cancel-in-progress : false
6016
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
17+ jobs :
18+ build :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Checkout
22+ uses : actions/checkout@v4
8323
84- # - name: Setup Node.js
85- # uses: actions/setup-node@v4
86- # with:
87- # node-version: '18'
88- # cache: 'yarn'
24+ - name : Setup Node.js
25+ uses : actions/setup-node@v4
26+ with :
27+ node-version : ' 18'
28+ cache : ' yarn'
8929
90- # - name: Setup Pages
91- # uses: actions/configure-pages@v4
92- # with:
93- # static_site_generator: next
30+ - name : Setup Pages
31+ uses : actions/configure-pages@v4
32+ with :
33+ static_site_generator : next
9434
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') }}-
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') }}-
10343
104- # - name: Install dependencies
105- # run: yarn install --frozen-lockfile
44+ - name : Install dependencies
45+ run : yarn install --frozen-lockfile
10646
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.*
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.*
11252
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
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
11858
119- # echo "Current next.config.ts content:"
120- # cat next.config.ts
59+ echo "Current next.config.ts content:"
60+ cat next.config.ts
12161
122- # echo "Running yarn build..."
123- # yarn build
62+ echo "Running yarn build..."
63+ yarn build
12464
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"
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"
13575
136- # echo "Trying manual static export..."
137- # rm -rf .next out
138- # NODE_ENV=production yarn next build
76+ echo "Trying manual static export..."
77+ rm -rf .next out
78+ NODE_ENV=production yarn next build
13979
140- # echo "After rebuild, checking directories:"
141- # ls -la ./
80+ echo "After rebuild, checking directories:"
81+ ls -la ./
14282
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"
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"
14787
148- # echo "Manual export attempt..."
149- # mkdir -p out
88+ echo "Manual export attempt..."
89+ mkdir -p out
15090
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
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
15797
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
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
163103
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
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
169109
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 }}
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 }}
178118
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"
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"
188128
189- # - name: Upload artifact
190- # uses: actions/upload-pages-artifact@v3
191- # with:
192- # path: ./out
129+ - name : Upload artifact
130+ uses : actions/upload-pages-artifact@v3
131+ with :
132+ path : ./out
193133
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
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
0 commit comments