Skip to content

Set up auto deployments #2

Set up auto deployments

Set up auto deployments #2

Workflow file for this run

name: Deploy
on:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- uses: actions/cache@v4
id: node-modules-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm clean-install
- run: npm run build
- uses: burnett01/rsync-deployments@796cf0d5e4b535745ce49d7429f77cf39e25ef39 # v7.0.1
with:
switches: --archive --delete --human-readable --recursive --verbose
path: _site/
remote_path: /var/www/virtual/${{ secrets.SSH_USERNAME }}/${{ vars.SITE_DIRECTORY }}
remote_host: ${{ secrets.SSH_HOST }}
remote_user: ${{ secrets.SSH_USERNAME }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
remote_key_pass: ${{ secrets.SSH_PRIVATE_KEY_PASS }}