mirror of
https://github.com/elisspace/blog-test.git
synced 2026-08-29 15:43:52 +00:00
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
# .github/workflows/ssh_deploy.yml
|
|
|
|
name: Deploy Eleventy via SSH
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE,
|
|
# so your workflow can access it
|
|
- uses: actions/checkout@main
|
|
|
|
# Build your static website with Eleventy
|
|
- name: Build Eleventy
|
|
uses: TartanLlama/actions-eleventy@master
|
|
with:
|
|
args: --output html # set output folder
|
|
install_dependencies: true
|
|
|
|
# Sync the _site folder to remote server
|
|
- name: Deploy to Server via SSH
|
|
uses: appleboy/ssh-action@master
|
|
with:
|
|
host: ${{ secrets.SSH_HOST }}
|
|
username: ${{ secrets.SSH_USERNAME }}
|
|
key: ${{ secrets.SSH_KEY }}
|
|
port: ${{ secrets.SSH_PORT }}
|
|
rm: true
|
|
source: "html/"
|
|
target: "${{ secrets.REMOTE_DIR }}"
|
|
|
|
# script: |
|
|
# cd /path/to/remote/folder
|
|
# rsync -avz --delete ./_site/ .
|
|
|
|
|
|
# Copying files and artifacts via SSH
|
|
# - name: Copying files to server
|
|
# uses: appleboy/scp-action@master
|
|
# with:
|
|
# host: ${{ secrets.REMOTE_HOST }}
|
|
# username: ${{ secrets.REMOTE_USER }}
|
|
# key: ${{ secrets.SSH_KEY }}
|
|
# # passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }}
|
|
# rm: true
|
|
# source: "html/"
|
|
# target: "${{ secrets.REMOTE_DIR }}" |