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/
|
||||
Reference in New Issue
Block a user