-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (46 loc) · 1.32 KB
/
static.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
name: Deploy static site
on:
push:
branches: ["master","feat/*"]
workflow_dispatch:
# Allow one concurrent deployment
concurrency:
group: "static"
cancel-in-progress: true
jobs:
deploy:
# outputs:
# branch: ${{ steps.clean_branch.outputs.branch }}
environment:
name: wallet
url: ${{ vars.WEBSITE }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
check-latest: true
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run deploy
- name: Get clean branch name
id: clean_branch
env:
RM_FEAT: "feat/"
run: |
export BRANCH=${GITHUB_REF_NAME//$RM_FEAT/}
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
- name: Deploy via rsync
uses: bnnanet/github-actions-rsync@master
with:
RSYNC_OPTIONS: -avzr --delete --exclude '.git*'
RSYNC_SOURCE: ./dist/
RSYNC_TARGET: ~/branch/${{ steps.clean_branch.outputs.branch }}
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_USERNAME: ${{secrets.SSH_USERNAME}}
SSH_HOSTNAME: ${{secrets.SSH_HOSTNAME}}
SSH_CONFIG: ${{secrets.SSH_CONFIG}}