-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.89 KB
/
production.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
name: Production deployment
on:
push:
tags:
- '**-production'
jobs:
deploy:
runs-on: ubuntu-latest
environment: deploy
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
- run: npm ci
- run: npm run build
- name: Deploy to Production via rsync
# https://github.com/easingthemes/ssh-deploy
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRODUCTION_PRIVATE_KEY }}
# rsync arguments explained (more detail here: https://ss64.com/bash/rsync_options.html)
#
# -r, --recursive This tells rsync to copy directories recursively. See also --dirs (-d).
# -l, --links When symlinks are encountered, recreate the symlink on the destination.
# -t, --times This tells rsync to transfer modification times along with the files and update them on the remote system.
# -D The -D option is equivalent to --devices --specials.
# -z, --compress With this option, rsync compresses the file data as it is sent to the destination machine
# -v, --verbose This option increases the amount of information you are given during the transfer.
# -O, --omit-dir-times This tells rsync to omit directories when it is preserving modification times (see --times).
# --delete This tells rsync to delete extraneous files from the receiving side (ones that aren't on the sending side),
# but only for the directories that are being synchronized.
ARGS: "-rltDzvO"
SOURCE: "build/"
REMOTE_HOST: ${{ secrets.REMOTE_PRODUCTION_HOST }} # format host.domain.com or IP
REMOTE_USER: ${{ secrets.REMOTE_PRODUCTION_USER }} # SSH user on receiving end
TARGET: ${{ secrets.REMOTE_PRODUCTION_TARGET }} # Base target directory, ex: /home/user/public_html