Files
esercitazione-http/.gitea/workflows/deploy.yaml
Francesco Mancuso 667dd1f803
All checks were successful
Deploy / trigger (push) Successful in 3s
Corretto il deploy: solo su main
Signed-off-by: Francesco Mancuso <hello@francescomancuso.it>
2026-02-11 21:10:34 +01:00

33 lines
1011 B
YAML

name: Deploy
on:
push:
branches:
- main
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Build & Deploy
env:
REPO_NAME: ${{ gitea.event.repository.name }}
REPO_OWNER: ${{ gitea.repository_owner }}
# Imposta la cartella che conterrà la root del sito!
# Default "/"
# Con nome "nome_cartella"
ROOT_DIR: "/"
# Cosa stai andando a pubblicare?
# - pages sito web statico
# - dynamic sito web dinamico con PHP
TYPE: "dynamic"
JOB_TOKEN: ${{ gitea.token }}
run: |
curl -f -s -S -X -v POST http://gitea-webhook:9000/hooks/trigger-deploy \
-H "Content-Type: application/json" \
-d "{
\"repository\": { \"name\": \"$REPO_NAME\" },
\"owner\": { \"username\": \"$REPO_OWNER\" },
\"root\": \"$ROOT_DIR\",
\"type\": \"$TYPE\",
\"token\": \"$JOB_TOKEN\"
}"