Skip to content

Switch to pnpm

Switch to pnpm #111

Workflow file for this run

name: Deploy to production
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
name: Docker image build
steps:
- uses: actions/checkout@v4
- name: Setup node and install dependencies
uses: actions/setup-node@v4
with:
node-version: "20.18.0"
- name: Login to docker hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build docker image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/backoffice \
--build-arg VITE_BASE_URL=${{ secrets.VITE_BASE_URL }} .
- name: Push docker image to Docker Hub
run: docker push ${{ secrets.DOCKER_USERNAME }}/backoffice:latest
deploy:
needs: build
runs-on: ubuntu-latest
name: Deployment
steps:
- name: Deploy using SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: 22
script: |
cd backoffice;
git pull;
docker stop backoffice;
docker rm backoffice;
docker pull akmatoff/backoffice:latest;
docker run --restart always -d -p 4000:4000 --name backoffice akmatoff/backoffice:latest