This commit is contained in:
@@ -2,13 +2,11 @@ name: Deploy Hugo site
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [main]
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -29,29 +27,8 @@ jobs:
|
|||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
hugo --minify
|
hugo --minify
|
||||||
|
|
||||||
- name: Configure SSH key
|
- name: Deploy locally to Nginx root
|
||||||
env:
|
|
||||||
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
install -d -m 700 ~/.ssh
|
test -d /deploy/portfolio
|
||||||
printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519
|
rsync -az --delete public/ /deploy/portfolio/
|
||||||
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/"
|
|
||||||
@@ -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_USER`: SSH user used for deployment
|
||||||
- `DEPLOY_PATH`: target directory served by your web server
|
- `DEPLOY_PATH`: target directory served by your web server
|
||||||
- `DEPLOY_SSH_KEY`: private SSH key for the deployment user
|
- `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:
|
Example target path:
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
baseURL = "https://example.com/"
|
baseURL = "https://portfolio.bouchard.sytes.net/"
|
||||||
languageCode = "en-us"
|
languageCode = "en-us"
|
||||||
title = "Ludovic Portfolio"
|
title = "Ludovic Portfolio"
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ title = "Ludovic Portfolio"
|
|||||||
role = "Developer"
|
role = "Developer"
|
||||||
tagline = "Selected projects, work, and experiments."
|
tagline = "Selected projects, work, and experiments."
|
||||||
intro = "I build thoughtful digital products and showcase the projects that matter most."
|
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/"
|
github = "https://github.com/"
|
||||||
linkedin = "https://www.linkedin.com/"
|
linkedin = "https://www.linkedin.com/"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user