Skip to content

Commit

Permalink
production deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
patatoid committed Jun 14, 2024
1 parent 4ffa318 commit 2ecb945
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit 2ecb945

Please sign in to comment.