Skip to content

Commit c8760b0

Browse files
Update nextjs.yml
1 parent afd6acd commit c8760b0

File tree

1 file changed

+3
-42
lines changed

1 file changed

+3
-42
lines changed

.github/workflows/nextjs.yml

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -72,44 +72,15 @@ jobs:
7272
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
7373
- name: Build with Next.js
7474
run: ${{ steps.detect-package-manager.outputs.runner }} next build
75-
- name: Prepare And Override Deployment
75+
- name: Prepare Deployment
7676
run: |
7777
mkdir -p deploy
7878
cp -r .next/server/pages/* deploy/
7979
mkdir -p deploy/_next/static/
8080
cp -r .next/static/* deploy/_next/static/
8181
cp .next/server/pages/en.html deploy/index.html
82-
mkdir -p deploy/_just/
83-
i=0
84-
if [ -d ./_just/js ]; then
85-
if [ "$(ls -A ./_just/js)" ]; then
86-
for file in ./_just/js/*; do
87-
cp "$file" deploy/_just/$i.js
88-
((i++))
89-
done
90-
else
91-
echo "Warning: _just/js directory is empty."
92-
exit 1
93-
fi
94-
else
95-
echo "Error: _just/js directory does not exist."
96-
exit 1
97-
fi
98-
i=0
99-
if [ -d ./_just/style ]; then
100-
if [ "$(ls -A ./_just/style)" ]; then
101-
for file in ./_just/style/*; do
102-
cp "$file" deploy/_just/$i.css
103-
((i++))
104-
done
105-
else
106-
echo "Warning: _just/style directory is empty."
107-
exit 1
108-
fi
109-
else
110-
echo "Error: _just/style directory does not exist."
111-
exit 1
112-
fi
82+
- name: API Endpoints
83+
run: |
11384
mkdir -p deploy/api/
11485
BUILD_ID=$(cat .next/BUILD_ID)
11586
echo "$BUILD_ID" > deploy/api/build-id
@@ -118,16 +89,6 @@ jobs:
11889
cp .next/build-manifest.json deploy/api/build-manifest
11990
cp .next/build-manifest.json deploy/api/build-manifest.json
12091
cp .next/build-manifest.json deploy/api/build-manifest.txt
121-
for html_file in deploy/*.html; do
122-
if grep -q "</head>" "$html_file"; then
123-
for js_file in deploy/_just/*.js; do
124-
echo "<script src=\"_just/$(basename "$js_file")\"></script>" >> "$html_file"
125-
done
126-
for css_file in deploy/_just/*.css; do
127-
echo "<link href=\"_just/$(basename "$css_file")\" rel=\"stylesheet\">" >> "$html_file"
128-
done
129-
fi
130-
done
13192
- name: Upload artifact
13293
uses: actions/upload-pages-artifact@v3
13394
with:

0 commit comments

Comments
 (0)