fix: add caching for Next.js build to improve deployment efficiency
This commit is contained in:
@@ -10,6 +10,7 @@ jobs:
|
|||||||
runs-on: website-deploy-runner
|
runs-on: website-deploy-runner
|
||||||
env:
|
env:
|
||||||
DOTNET_INSTALL_DIR: "$HOME/.dotnet"
|
DOTNET_INSTALL_DIR: "$HOME/.dotnet"
|
||||||
|
NEXT_TELEMETRY_DISABLED: '1'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
@@ -36,6 +37,14 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-node-
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
|
- name: Cache Next.js build cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: frontend/.next/cache
|
||||||
|
key: ${{ runner.os }}-next-cache-${{ hashFiles('frontend/package-lock.json') }}-${{ env.NODE_VERSION || 'node' }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-next-cache-
|
||||||
|
|
||||||
- name: Create Backend appsettings.Production.json
|
- name: Create Backend appsettings.Production.json
|
||||||
run: |
|
run: |
|
||||||
echo "Creating backend appsettings.Production.json file..."
|
echo "Creating backend appsettings.Production.json file..."
|
||||||
@@ -107,6 +116,8 @@ jobs:
|
|||||||
echo "rsync backend ecosystem exit: $?"
|
echo "rsync backend ecosystem exit: $?"
|
||||||
|
|
||||||
- name: Restart Applications with PM2
|
- name: Restart Applications with PM2
|
||||||
|
env:
|
||||||
|
DEPLOY_PATH: ${{ vars.DEPLOY_PATH }}
|
||||||
run: |
|
run: |
|
||||||
echo "Restarting applications with PM2..."
|
echo "Restarting applications with PM2..."
|
||||||
restart-portfolio
|
restart-portfolio
|
||||||
Reference in New Issue
Block a user