Skip to content

Update Workflow

Update Workflow #16

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: Node.js CI
on:
push:
branches: ["main"]
jobs:
build:
runs-on: self-hosted
defaults:
run:
working-directory: ./server/
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
cache-dependency-path: "./server/pnpm-lock.yaml"
- name: Install Dependencies
run: pnpm install
- name: Create .env file
run: |
touch .env
echo "PORT=${{ secrets.PORT }}" >> .env
echo "DB_URI=${{ secrets.DB_URI }}" >> .env
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> .env
echo "SENDGRID_API_KEY=${{ secrets.SENDGRID_API_KEY }}" >> .env
echo "EMAIL_FROM=${{ secrets.EMAIL_FROM }}" >> .env
echo "CLIENT_URL=${{ secrets.CLIENT_URL }}" >> .env
echo "MAILERSEND_API_KEY=${{ secrets.MAILERSEND_API_KEY }}" >> .env
echo "SMTP_HOST=${{ secrets.SMTP_HOST }}" >> .env
echo "SMTP_USER=${{ secrets.SMTP_USER }}" >> .env
echo "SMTP_PASS=${{ secrets.SMTP_PASS }}" >> .env
- name: Restart PM2
run: pm2 restart Uplyze-Backend