Skip to content

Bug fix

Bug fix #8

Workflow file for this run

name: CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: 20.x
- name: Install dependencies
run: npm install
- name: Create .env file
run: |
touch .env
echo "APP_PORT=${{ secrets.APP_PORT }}" > .env
echo "BOT=${{ secrets.BOT }}" >> .env
echo "ADMIN=${{ secrets.ADMIN }}" >> .env
echo "DB_CONNECTION_STRING=${{ secrets.DB_CONNECTION_STRING }}" >> .env
- name: Stop and Remove existing container
run: |
docker stop SolarBackend || true
docker rm SolarBackend || true
- name: Build Docker Image
run: docker build -t aerscs/solar-backend-docker:latest .
- name: Run Docker container
run: docker run -d --restart unless-stopped -p 3000:${{ secrets.APP_PORT }} --name SolarBackend aerscs/solar-backend-docker:latest