This repository has been archived by the owner on Jan 28, 2025. It is now read-only.
Merge pull request #33 from BakirGracic/dependabot/npm_and_yarn/src/n… #71
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 | |
paths: | |
- 'src/**' | |
workflow_dispatch: | |
jobs: | |
build_and_deploy: | |
runs-on: self-hosted | |
environment: production | |
steps: | |
- name: Checkout Repository Code | |
uses: actions/checkout@v4 | |
- name: Use Node.js (latest) | |
uses: actions/setup-node@v4 | |
- name: Install NPM Dependencies | |
run: npm ci | |
working-directory: src | |
- name: Build NextJS | |
working-directory: src | |
env: | |
GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }} | |
run: | | |
npx next telemetry disable | |
pm2 stop 0 | |
rm -rf .next | |
npm run build | |
- name: Run NextJS | |
working-directory: src | |
run: | | |
pm2 restart 0 --update-env |