up link #28
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |