wiki/.forgejo/workflows/deploy.yml

63 lines
1.9 KiB
YAML
Raw Normal View History

2024-01-10 15:24:17 +00:00
on: [push]
jobs:
deploy:
runs-on: gitpot_main
container:
2024-01-10 15:48:42 +00:00
image: ghcr.io/peaceiris/hugo:latest-full
2024-01-10 15:24:17 +00:00
steps:
- name: Checkout Repository
uses: actions/checkout@v4
2024-01-10 16:11:24 +00:00
- name: Install Dependencies
run: |
apt-get update
apt-get install -y rsync
2024-01-10 15:28:57 +00:00
2024-01-10 15:24:17 +00:00
- name: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- name: Build Hugo Site
run: hugo
2024-01-10 16:26:54 +00:00
# - name: Set up SSH Key
# run: |
# mkdir -p ~/.ssh
# echo "${{ secrets.SSH_PRIV_KEY }}" > ~/.ssh/id_ed25519
# chmod 600 ~/.ssh/id_ed25519
2024-01-10 16:14:31 +00:00
2024-01-10 16:26:54 +00:00
# - name: Deploy to SSH Host
# run: |
# rsync -avz --delete -e "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no" ./public/ wiki-deploy@${{ secrets.SSH_HOST }}:/var/www/wiki.lunivity.com/
# - name: Remove SSH Key
# run: |
# rm -rf ~/.ssh
# echo "SSH Key removed."
- uses: https://github.com/mschmitt/rsync-with-ssh-agent@v2
with:
SSH_KEY: ${{ secrets.SSH_PRIV_KEY }}
SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }}
SSH_USER: wiki-deploy
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}
RSYNC_LOCAL_PATH: './public'
RSYNC_REMOTE_PATH: '/var/www/wiki.lunivity.com/'
RSYNC_OPTIONS: '--recursive --delete --delete-before --verbose --dry-run'
2024-01-10 16:09:26 +00:00
# - name: Deploy to SSH Host
# uses: https://github.com/Creepios/sftp-action@v1.0.5
# with:
# host: ${{ secrets.SSH_HOST }}
# port: 22
# username: wiki-deploy
# privateKey: ${{ secrets.SSH_PRIV_KEY }}
# passphrase: ${{ secrets.SSH_PASSPHRASE }}
# localPath: './public'
# remotePath: '/var/www/wiki.lunivity.com/'