fix: i file, una volta validati, vengono ora copiati sulla macchina proxi con ssh
Some checks failed
Updates the graph by copying the updated files in the right directory / build-and-deploy (push) Failing after 2s

This commit is contained in:
Freekkettone 2025-11-14 03:36:09 +01:00
parent 38d838ad6b
commit 3b46f3d5b1

View file

@ -1,4 +1,4 @@
name: Updates the graph by copying the updated files in the rigth directory name: Updates the graph by copying the updated files in the right directory
on: on:
push: push:
@ -8,13 +8,16 @@ on:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: usainbolt runs-on: usainbolt
steps: steps:
# 1. Checkout del codice (scarica la repo usando checkout@v4: un insieme di comandi prefatto) # Checkout means: tirati giù la repo in locale
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
# 1. Validazione del JSON - name: Install jq if needed (used to validate json files)
- name: Validate arf.json (the file with the content of the graph) run: sudo apt-get update && sudo apt-get install -y jq
- name: Validate arf.json
run: | run: |
if ! jq empty public/arf.json; then if ! jq empty public/arf.json; then
echo "❌ arf.json non è un JSON valido" echo "❌ arf.json non è un JSON valido"
@ -22,7 +25,11 @@ jobs:
fi fi
shell: bash shell: bash
# 2. Copia dei files da public in var/www/... - name: Copy files to reverse proxy
- name: File copy to update web page uses: appleboy/ssh-action@v1.0.3
run: | with:
cp -r public/* /var/www/miniera.hackinpovo.it/html/ host: ${{ secrets.PROXY_HOST }}
username: ${{ secrets.PROXY_USER }}
key: ${{ secrets.PROXY_SSH_KEY }}
script: |
cp -r /home/proxi/resources/public/* /var/www/miniera.hackinpovo.it/html/