Jafner.net/homelab/.gitea/workflows/deploy-fighter.yml

31 lines
998 B
YAML
Raw Normal View History

2024-02-13 10:55:45 -08:00
name: Deploy to Fighter
run-name: ${{ gitea.actor }} deploying
on: [push]
jobs:
Deploy-to-Fighter:
runs-on: internal
steps:
- name: Pull latest code onto Fighter via SSH
uses: appleboy/ssh-action@master
with:
host: ${{ vars.SSH_HOST_IP_FIGHTER }} # this is a LAN IP
username: ${{ vars.SSH_USERNAME_FIGHTER }}
key: ${{ secrets.SSH_KEY_DEPLOY_TO_FIGHTER }}
2024-02-13 10:55:45 -08:00
script: |
cd ~/homelab
git pull
2024-02-13 11:27:37 -08:00
- name: Validate compose configs
uses: appleboy/ssh-action@master
with:
host: ${{ vars.SSH_HOST_IP_FIGHTER }} # this is a LAN IP
username: ${{ vars.SSH_USERNAME_FIGHTER }}
key: ${{ secrets.SSH_KEY_DEPLOY_TO_FIGHTER }}
script: |
for stack in /home/$USER/homelab/fighter/config/*
2024-02-13 12:55:59 -08:00
do cd $stack &&
echo "===== Validating $(basename $PWD) =====" &&
docker compose config > /dev/null
2024-02-13 11:27:37 -08:00
done