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
|
||||
env:
|
||||
DOTNET_INSTALL_DIR: "$HOME/.dotnet"
|
||||
NEXT_TELEMETRY_DISABLED: '1'
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
@@ -36,6 +37,14 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ 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
|
||||
run: |
|
||||
echo "Creating backend appsettings.Production.json file..."
|
||||
@@ -107,6 +116,8 @@ jobs:
|
||||
echo "rsync backend ecosystem exit: $?"
|
||||
|
||||
- name: Restart Applications with PM2
|
||||
env:
|
||||
DEPLOY_PATH: ${{ vars.DEPLOY_PATH }}
|
||||
run: |
|
||||
echo "Restarting applications with PM2..."
|
||||
restart-portfolio
|
||||
Reference in New Issue
Block a user