diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 6e6ca28..6353a1b 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Build and Deploy Astro Site +name: Build and Deploy Next.js Site on: push: @@ -12,11 +12,31 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Setup Node.js and cache + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + + - name: Cache Next.js build + uses: actions/cache@v4 + with: + path: | + ~/.npm + ${{ github.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: Disable Next.js telemetry + run: npx next telemetry disable + + - name: Install dependencies + run: npm ci + - name: Build and deploy run: | - npm install mv src/app/\(cms\) src/app/_cms npm run build - # Deploy rm -rf /var/www/sites/dave-dmg/blog/* cp -r out/* /var/www/sites/dave-dmg/blog/ \ No newline at end of file