Настроил автоматическую загрузку фронтенда на сервер
This commit is contained in:
parent
996aafec6c
commit
d1f7493a16
1 changed files with 28 additions and 2 deletions
|
@ -9,7 +9,7 @@ jobs:
|
|||
image: docker.io/library/node:24
|
||||
steps:
|
||||
- name: Install Git
|
||||
run: apt update && apt install git
|
||||
run: apt update && apt install -y git
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
@ -42,3 +42,29 @@ jobs:
|
|||
with:
|
||||
name: website
|
||||
path: build/
|
||||
|
||||
deploy:
|
||||
needs: [build]
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Install rsync
|
||||
run: apt update && apt install -y 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 }}
|
Loading…
Add table
Add a link
Reference in a new issue