diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index aeca35a..ac20f85 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -57,6 +57,22 @@ jobs: run: working-directory: ./ steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install SSH client + run: | + apt-get update && apt-get install -y openssh-client + + - name: Setup SSH inside container + run: | + mkdir -p ~/.ssh + echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + + # Add the container host to known_hosts + ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts + - name: Compress backend run: tar -czf backend.tar.gz backend @@ -70,6 +86,13 @@ jobs: tar -xzf /tmp/backend.tar.gz -C /var/www/app EOF + - name: Install dependencies on server + run: | + ssh deploy@${{ secrets.DEPLOY_HOST }} << 'EOF' + cd /var/www/app/backend/ && npm i + EOF + + deploy: runs-on: docker container: