Skip to content

update cd script

update cd script #74

Workflow file for this run

name: frontend-cd
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deployment
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
if [ -d repo ]; then
cd repo
docker compose down
fi
cd ..
tar -czf "repo_$(date +%s).tar.gz" repo
echo "${{ secrets.SSH_PASSWORD }}" | sudo -S rm -rf repo
git clone https://github.com/${{ github.repository }} repo --depth=1
cd repo
echo NEXT_PUBLIC_BACKEND_HOST=${{ vars.BACKEND_HOST }} > frontend-v2/.env.local
docker compose up --build -d