Merge pull request #25 from BakirGracic/dependabot/npm_and_yarn/eslin… #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Next.js CD | |
concurrency: | |
group: production | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: self-hosted | |
environment: production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js (22.x) | |
uses: actions/setup-node@v4 | |
- name: Install Dependencies | |
run: rm -rf node_modules && npm i --force | |
- name: Build NextJS | |
env: | |
GA_ID: ${{ secrets.GA_ID }} | |
run: | | |
npx next telemetry disable | |
pm2 stop 0 | |
rm -rf .next | |
npm run build | |
- name: Start NextJS | |
run: | | |
pm2 restart 0 --update-env |