Skip to content

update cd script

update cd script #71

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 --utc --iso-8601=seconds).tar.gz" repo
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