enhance/small changes to trigger redeploy - updated the cd file - add… #31
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: CD | |
on: | |
push: | |
branches: ["main"] | |
paths-ignore: | |
- "**/README.md" | |
- "**/LICENSE.txt" | |
jobs: | |
build: | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setting env variables | |
run: | | |
touch .env | |
echo DATABASE_URL=${{ secrets.DATABASE_URL }} >> .env | |
echo SECRET_COOKIE_PASSWORD=${{ secrets.SECRET_COOKIE_PASSWORD }} >> .env | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: Installing dependencies | |
run: npm ci | |
- name: Installing sharp | |
run: npm i sharp | |
- name: Building a production version | |
run: npm run build | |
- name: Restarting the server | |
run: pm2 restart clothing-shop -s |