git actions
Some checks failed
Build and Deploy Hugo Site / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy Hugo Site / build-and-deploy (push) Has been cancelled
This commit is contained in:
parent
cdb50e82a3
commit
40a27b79a0
1 changed files with 33 additions and 0 deletions
33
.forgejo/workflows/deploy.yml
Normal file
33
.forgejo/workflows/deploy.yml
Normal file
|
@ -0,0 +1,33 @@
|
|||
name: Build and Deploy Hugo Site
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # o master, o un altro branch
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: usainbolt
|
||||
steps:
|
||||
|
||||
# 1. Checkout del codice (scarica la repo usando un insieme di comandi prefatto)
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# 2. Build del sito
|
||||
- name: Build Hugo site
|
||||
run: |
|
||||
hugo --minify
|
||||
cat content/_index.md | grep ":P"
|
||||
|
||||
# 3. Deploy via rsync
|
||||
- name: Deploy to server
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_PRIVATE_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
printf '%s\n' "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -H 10.10.0.3 >> ~/.ssh/known_hosts
|
||||
rsync -avz --delete public/ proxi@10.10.0.3:/var/www/html
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue