-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
echo "Starting theme building process..." | ||
|
||
# Install | ||
apt update | ||
apt install -y ca-certificates curl gnupg | ||
mkdir -p /etc/apt/keyrings | ||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
|
||
NODE_MAJOR=20 | ||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | ||
|
||
apt update | ||
apt install nodejs -y | ||
|
||
# Build | ||
npm ci --omit dev | ||
su www-data -s npm run build | ||
|
||
# Cleanup | ||
npm cache clean --force | ||
apt purge curl gnupg nodejs -y | ||
apt autoremove -y | ||
rm -r /etc/apt/sources.list.d/nodesource.list | ||
rm -r /etc/apt/keyrings/nodesource.gpg | ||
|
||
rm -rf /app/node_modules/ | ||
|
||
echo "Theme building process complete. Cleaned up all dependecies to save space." |