-
Notifications
You must be signed in to change notification settings - Fork 17
41 lines (41 loc) · 1.24 KB
/
sandbox-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
38
39
40
41
name: CICD
on:
push:
branches:
- main
jobs:
build:
name: build-deploy-to-sandbox
environment: sandbox
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: |
yarn install
yarn workspace @shiksha/common-lib build
yarn install
yarn build
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_HOST }}
- name: Adding known hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Copy Package
run: |
sh ./scripts/pack-prod-build.sh
rsync shiksha-ui.tar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/sandbox.shikshaplatform.io/shiksha-ui.tar
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /var/www/sandbox.shikshaplatform.io/public
rm -rf *
cp ../shiksha-ui.tar ./
tar -xvf shiksha-ui.tar .