resources/.forgejo/workflows/graph-updater.yml
Freekkettone 1c4c0f5132
Some checks failed
Updates the graph by copying the updated files in the right directory / build-and-deploy (push) Failing after 3s
boh
2025-11-14 05:16:31 +01:00

52 lines
1.6 KiB
YAML

name: Updates the graph by copying the updated files in the right directory
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: usainbolt
steps:
#DA QUI IN POI, RICORDA CHE È COME SE FOSSI SUL GITRUNNER usainbolt
# Checkout means: mi tiro giù la repo in locale
- name: Checkout repository
uses: actions/checkout@v4
# - name: Apt update
# run: |
# sudo apt update
#
# - name: Install jq if needed (used to validate json files)
# run: |
# sudo apt install -y jq
- name: Validate arf.json
run: |
if ! jq empty public/arf.json; then
echo "❌ arf.json non è un JSON valido"
exit 1
fi
shell: bash
- name: Copy the secret ssh in .ssh
env:
SSH_KEY: ${{ secrets.PROXY_SSH_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
# Fanculo i pacchetti già pronti per usare ssh su questi yml
# (tieni a mente che con questa sola copia la repo su proxi rimane outdated perché viene fatta la copia direttamente dentro /var/www senza toccare ~/resources)
- name: Copy files to reverse proxy /var/www/...
env:
SSH_USER: ${{ secrets.PROXY_USER }}
SSH_HOST: ${{ secrets.PROXY_HOST }}
run: |
scp -i ~/.ssh/id_ed25519 \
-o StrictHostKeyChecking=no \
-r public/* $SSH_USER@$SSH_HOST:/var/www/miniera.hackinpovo.it/html/