-
-
Notifications
You must be signed in to change notification settings - Fork 9
52 lines (45 loc) · 1.46 KB
/
deploy.yaml
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
---
name: 'deploy'
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# third-party action that cancels previous runs
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Cloning repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Cache Node.js modules
uses: actions/cache@v3
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_DOKKU_KEY }}
- name: Deploy
run: |
ssh-keyscan ${{ secrets.DOKKU_HOST }} >> ~/.ssh/known_hosts
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions"
git config --global push.default simple
git remote add deploy dokku@${{ secrets.DOKKU_HOST }}:banmanagement.com >/dev/null 2>&1
git stash --all
git checkout master
git push -f deploy master >/dev/null 2>&1