mirror of
https://github.com/agresdominik/website.git
synced 2026-07-21 16:10:54 +00:00
399a8cb73d
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
44 lines
913 B
YAML
44 lines
913 B
YAML
name: Deploy Changes to VPS
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: [self-hosted, linux, x64]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Deploy to VPS
|
|
uses: appleboy/ssh-action@v0.1.9
|
|
with:
|
|
host: ${{ secrets.VPS_HOST }}
|
|
username: agres
|
|
key: ${{ secrets.VPS_SSH_KEY }}
|
|
port: 22
|
|
script: |
|
|
set -e
|
|
|
|
# Pull latest changes
|
|
cd /home/agres/website
|
|
git pull origin main
|
|
|
|
# Build Project
|
|
make build
|
|
|
|
# Copy compiled Hugo site to web root
|
|
sudo rsync -av --delete --no-group --no-owner /home/agres/website/blog/public/ /var/www/html/
|
|
|
|
# Fix permissions
|
|
sudo chown -R www-data:www-data /var/www/html
|
|
|
|
# Reload Nginx
|
|
sudo systemctl reload nginx
|
|
|
|
# Clean
|
|
make clean
|