This commit is contained in:
@@ -2,13 +2,11 @@ name: Deploy Hugo site
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -29,29 +27,8 @@ jobs:
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
hugo --minify
|
||||
|
||||
- name: Configure SSH key
|
||||
env:
|
||||
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
- name: Deploy locally to Nginx root
|
||||
run: |
|
||||
set -eu
|
||||
install -d -m 700 ~/.ssh
|
||||
printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
|
||||
- name: Trust deployment host
|
||||
env:
|
||||
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
||||
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
|
||||
run: |
|
||||
set -eu
|
||||
ssh-keyscan -p "$DEPLOY_PORT" -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Upload generated site
|
||||
env:
|
||||
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
||||
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
|
||||
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
|
||||
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
||||
run: |
|
||||
set -eu
|
||||
rsync -az --delete -e "ssh -p $DEPLOY_PORT" public/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/"
|
||||
test -d /deploy/portfolio
|
||||
rsync -az --delete public/ /deploy/portfolio/
|
||||
@@ -145,6 +145,9 @@ To use it, you need a Gitea runner and the following repository secrets:
|
||||
- `DEPLOY_USER`: SSH user used for deployment
|
||||
- `DEPLOY_PATH`: target directory served by your web server
|
||||
- `DEPLOY_SSH_KEY`: private SSH key for the deployment user
|
||||
- `DEPLOY_KNOWN_HOSTS`: optional full `known_hosts` entry to avoid runtime `ssh-keyscan`
|
||||
|
||||
Important: `DEPLOY_PORT` is the SSH port used for deployment, not the Nginx or website port. If Nginx serves the site on `8090` but SSH still listens on `22`, then `DEPLOY_PORT` must be `22`.
|
||||
|
||||
Example target path:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
baseURL = "https://example.com/"
|
||||
baseURL = "https://portfolio.bouchard.sytes.net/"
|
||||
languageCode = "en-us"
|
||||
title = "Ludovic Portfolio"
|
||||
|
||||
@@ -7,7 +7,7 @@ title = "Ludovic Portfolio"
|
||||
role = "Developer"
|
||||
tagline = "Selected projects, work, and experiments."
|
||||
intro = "I build thoughtful digital products and showcase the projects that matter most."
|
||||
email = "hello@example.com"
|
||||
email = "ludovicb1239@gmail.com"
|
||||
github = "https://github.com/"
|
||||
linkedin = "https://www.linkedin.com/"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user