-
Notifications
You must be signed in to change notification settings - Fork 27
43 lines (41 loc) · 1.43 KB
/
development.yml
File metadata and controls
43 lines (41 loc) · 1.43 KB
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
42
43
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ development ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn build --env staging
- name: Create temp Directory
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
script: mkdir -p ~/frontends/hackerblocks.staging/temp
- name: Upload Build
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
source: "dist"
target: "~/frontends/hackerblocks.staging/temp"
- name: Replace New Build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
script: |
cp -rf ~/frontends/hackerblocks.staging/current/* ~/frontends/hackerblocks.staging/previous &&
rm -rf ~/frontends/hackerblocks.staging/current/* &&
cp -rf ~/frontends/hackerblocks.staging/temp/dist/* ~/frontends/hackerblocks.staging/current &&
rm -rf ~/frontends/hackerblocks.staging/temp