Skip to content

Merge pull request #101 from Boost-Coder/feature/compare-#100 #44

Merge pull request #101 from Boost-Coder/feature/compare-#100

Merge pull request #101 from Boost-Coder/feature/compare-#100 #44

Workflow file for this run

name: Backend CD
on:
push:
branches: [ "develop" ]
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set env
run: |
mkdir envs
echo "DB_HOST=${{ secrets.DB_HOST }}" >> envs/prod.env
echo "DB_PORT=${{ secrets.DB_PORT }}" >> envs/prod.env
echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> envs/prod.env
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> envs/prod.env
echo "DB_DATABASE=${{ secrets.DB_DATABASE }}" >> envs/prod.env
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> envs/prod.env
echo "JWT_EXPIRES_IN=${{ secrets.JWT_EXPIRES_IN }}" >> envs/prod.env
echo "JWT_REFRESH_SECRET=${{ secrets.JWT_REFRESH_SECRET }}" >> envs/prod.env
echo "JWT_REFRESH_EXPIRES_IN=${{ secrets.JWT_REFRESH_EXPIRES_IN }}" >> envs/prod.env
- name: Build docker image
run: docker build . -t rankin:latest
deploy:
needs: build
runs-on: self-hosted
steps:
- name: Stop docker
run: |
docker stop rankin && docker rm rankin
- name: Run docker
if: always()
run: |
docker run --name rankin -d -p 3000:3000 -v /var/rankin/logs:/app/logs rankin:latest