-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (55 loc) · 1.5 KB
/
build_prod.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Deploy to production
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14.17.6
- run: npm install
- run: npm run generate
env:
BASE_URL: https://www.projectceleste.com
- run: rm dist/README.md
- run: rm dist/robots.txt
- run: rm dist/.nojekyll
- run: mv dist/robots.prod.txt dist/robots.txt
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: dist
path: dist/
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: dist
- name: Delete old files
uses: appleboy/ssh-action@v0.1.3
with:
host: ${{ vars.DEPLOY_HOST }}
username: ${{ vars.DEPLOY_USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ vars.DEPLOY_PORT }}
script: |
cd ${{ vars.DEPLOY_TARGET_PROD }}
rm -rf *
- name: Upload files
uses: appleboy/scp-action@v0.1.3
with:
host: ${{ vars.DEPLOY_HOST }}
username: ${{ vars.DEPLOY_USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ vars.DEPLOY_PORT }}
strip_components: 1
source: "dist"
target: "${{ vars.DEPLOY_TARGET_PROD }}"