From 3b46f3d5b1ee3906bbf1d9bfd07bc717c891e935 Mon Sep 17 00:00:00 2001 From: Freekkettone Date: Fri, 14 Nov 2025 03:36:09 +0100 Subject: [PATCH] fix: i file, una volta validati, vengono ora copiati sulla macchina proxi con ssh --- .forgejo/workflows/graph-updater.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/graph-updater.yml b/.forgejo/workflows/graph-updater.yml index efea9db..253c934 100644 --- a/.forgejo/workflows/graph-updater.yml +++ b/.forgejo/workflows/graph-updater.yml @@ -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: push: @@ -8,13 +8,16 @@ on: jobs: build-and-deploy: runs-on: usainbolt + 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 uses: actions/checkout@v4 - # 1. Validazione del JSON - - name: Validate arf.json (the file with the content of the graph) + - name: Install jq if needed (used to validate json files) + run: sudo apt-get update && sudo apt-get install -y jq + + - name: Validate arf.json run: | if ! jq empty public/arf.json; then echo "❌ arf.json non è un JSON valido" @@ -22,7 +25,11 @@ jobs: fi shell: bash - # 2. Copia dei files da public in var/www/... - - name: File copy to update web page - run: | - cp -r public/* /var/www/miniera.hackinpovo.it/html/ + - name: Copy files to reverse proxy + uses: appleboy/ssh-action@v1.0.3 + with: + 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/