-
Notifications
You must be signed in to change notification settings - Fork 32
41 lines (36 loc) · 1.42 KB
/
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: deploy
on:
push:
branches: [ "namada-mainnet" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
DEPLOY_DIR: /var/www/html/namada.omniflix.co
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-and-deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: login to remote instance and build app
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.INSYNC_DEV_SSH_SERVER }}
username: ${{ secrets.INSYNC_DEV_SSH_USER }}
key: ${{ secrets.INSYNC_DEV_SSH_KEY }}
port: ${{ secrets.PORT }}
envs: GITHUB_REPOSITORY,DEPLOY_DIR
script: |
[ -d "$HOME/$GITHUB_REPOSITORY" ] && rm -rf "$HOME/$GITHUB_REPOSITORY"
mkdir -p "$HOME/$GITHUB_REPOSITORY"
git clone https://github.com/$GITHUB_REPOSITORY "$HOME/$GITHUB_REPOSITORY"
cd "$HOME/$GITHUB_REPOSITORY"
git checkout namada-mainnet &&
git pull origin namada-mainnet &&
yarn &&
yarn build &&
sudo rm -rf "${DEPLOY_DIR}" &&
sudo mkdir -p "${DEPLOY_DIR}" &&
sudo mv ./build/ "${DEPLOY_DIR}"