diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 09d9050..8b72688 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -5,6 +5,8 @@ on: branches: - main + + jobs: deploy: runs-on: website-deploy-runner @@ -39,6 +41,17 @@ jobs: echo "NEXT_PUBLIC_GITHUB_URL=${{ vars.NEXT_PUBLIC_GITHUB_URL }}" >> .env echo "NEXT_PUBLIC_LINKEDIN_URL=${{ vars.NEXT_PUBLIC_LINKEDIN_URL }}" >> .env + - name: Cache Node Modules and Next.js Build + # Caching node_modules and Next.js build cache to speed up subsequent builds + uses: actions/cache@v4 + with: + path: | + ~/.npm + ${{ gitea.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- + - name: Install Dependencies and Build run: | echo "Installing backend dependencies..." @@ -57,4 +70,5 @@ jobs: echo "Restarting applications with PM2..." pm2 startOrRestart backend/ecosystem.config.js --update-env pm2 startOrRestart frontend/ecosystem.config.js - echo "Deployment successful!" \ No newline at end of file + echo "Deployment successful!" +