Настроил автоматическую загрузку фронтенда на сервер
Some checks failed
/ build (push) Successful in 3m53s
/ deploy (push) Failing after 33s

This commit is contained in:
Иван Кузьменко 2025-07-18 22:54:08 +03:00
parent 996aafec6c
commit fcc564fbfe

View file

@ -41,4 +41,30 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: website
path: build/
path: build/
deploy:
needs: [build]
runs-on: docker
steps:
- name: Install rsync
run: apt update && apt install rsync
- uses: actions/download-artifact@v3
with:
name: website
path: build/
- name: Add the private key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_deploy
chmod 600 ~/.ssh/id_deploy
- name: Make the known_hosts file
run: |
ssh-keyscan -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_ADDRESS }} >> ~/.ssh/known_hosts
- name: Upload folder with rsync
run: |
rsync -rvz --delete --dry-run -e "ssh -p ${{ secrets.DEPLOY_PORT }} -i ~/.ssh/id_deploy" ./build ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_ADDRESS }}:${{ secrets.DEPLOY_TARGET_FOLDER }}