Skip to content

refactor: down and up instead of restarting #23

refactor: down and up instead of restarting

refactor: down and up instead of restarting #23

Workflow file for this run

name: Frontend Deploy
on:
push:
branches:
- main
paths:
- frontend/**
jobs:
deploy:
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nodejs 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: "frontend/package-lock.json"
- name: Install modules
working-directory: frontend
run: npm ci
- name: Build
working-directory: frontend
run: npm run build
- name: Copy dist
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: docker-compose.yaml, frontend/dist/
target: ~/${{ github.event.repository.name }}
- name: Reload docker compose
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
cd ~/${{ github.event.repository.name }}
docker compose stop fe
docker compose rm -f fe
docker compose up -d fe