-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.11 KB
/
build-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Build and deploy code
on:
push:
branches:
- "main"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Run build command
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DEPLOYMENT_HOST}}
username: ${{secrets.DEPLOYMENT_USERNAME}}
key: ${{secrets.DEPLOYMENT_SSH_KEY}}
script: |
cd /home/${{secrets.DEPLOYMENT_USERNAME}}/zolza-hairstyles-web
git reset --hard
git pull
echo '${{secrets.DEPLOYMENT_PASSWORD}}' | sudo -S npm update -g npm
npm install
npm run build
deploy:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Deploy to the server
uses: appleboy/ssh-action@master
with:
host: ${{secrets.DEPLOYMENT_HOST}}
username: ${{secrets.DEPLOYMENT_USERNAME}}
key: ${{secrets.DEPLOYMENT_SSH_KEY}}
script: |
cd /home/${{secrets.DEPLOYMENT_USERNAME}}/zolza-hairstyles-web
echo '${{secrets.DEPLOYMENT_PASSWORD}}' | sudo -S cp -r ./dist /var/www/zolza-hairstyles.pl