Server Switching #25
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: Azure CI/CD Pipeline | |
on: | |
push: | |
branches: [ "Production" ] | |
jobs: | |
build: | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
node-version: [22.6.0] | |
steps: | |
- name : Truning Maintenance Mode on | |
run: sudo touch /var/www/html/maintenance.flag | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Create .env file | |
run: echo "${{secrets.ENV_VARIABLE}}" > .env | |
- name: Load .env varables | |
run: | | |
export $(grep -v '^#' .env | xargs) | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm run build | |
- name: Change directory | |
run: cd /home/aiflavaoured-sourabh/actions-runner/_work/ai_flavoured/ai_flavoured | |
- run: pm2 restart 0 | |
- name : Truning Maintenance Mode off | |
run: sudo rm /var/www/html/maintenance.flag | |
- run: sudo systemctl restart nginx | |