Skip to content

Merge pull request #27 from LuyxDevelopment/newdev #64

Merge pull request #27 from LuyxDevelopment/newdev

Merge pull request #27 from LuyxDevelopment/newdev #64

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Next.js Deployment
on:
workflow_dispatch:
push:
branches: [ master ]
jobs:
build:
runs-on: [self-hosted, temp]
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- run: |
echo "${{ secrets.ENV_FILE }}" > .env.local
- run: npm ci
- run: npm run build --if-present
- run: pm2 restart aesculapia-website