-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy_from_production_branch.yml
More file actions
44 lines (37 loc) · 1.19 KB
/
deploy_from_production_branch.yml
File metadata and controls
44 lines (37 loc) · 1.19 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
44
name: Deploy into Production
on:
push:
branches:
- production
jobs:
build_bundle:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout main branch
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install dependencies and build bundle
run: |
cd front
npm ci
npm run build
- name: Deploy static bundle to DO Droplet
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
source: "/home/runner/work/tokyo-python-society-site/tokyo-python-society-site/front/out"
target: "test"
- name: Create SSH key
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.KEY }}" > ~/.ssh/id_rsa
echo "${{ secrets.KNOWN_HOSTS }}" > ~/.ssh/known_hosts
- name: Replace current bundle
run: ssh -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "/home/tps/scripts/serve_out.sh"