2024-02-14 00:23:36 -08:00
|
|
|
name: Deploy to Wizard
|
|
|
|
run-name: ${{ gitea.actor }} deploying
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- 'wizard/**'
|
|
|
|
|
|
|
|
jobs:
|
2024-02-14 10:36:48 -08:00
|
|
|
Deploy:
|
2024-02-14 00:23:36 -08:00
|
|
|
runs-on: fighter
|
|
|
|
steps:
|
2024-02-14 10:36:48 -08:00
|
|
|
- name: Pull latest code onto host via SSH
|
2024-02-14 00:23:36 -08:00
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ vars.SSH_HOST_IP_WIZARD }} # this is a LAN IP
|
|
|
|
username: ${{ vars.SSH_USERNAME_WIZARD }}
|
|
|
|
key: ${{ secrets.SSH_KEY_DEPLOY_TO_WIZARD }}
|
|
|
|
script: |
|
|
|
|
cd ~/homelab
|
|
|
|
git pull
|
2024-02-14 11:19:00 -08:00
|
|
|
- name: Fix script permissions
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ vars.SSH_HOST_IP_WIZARD }} # this is a LAN IP
|
|
|
|
username: ${{ vars.SSH_USERNAME_WIZARD }}
|
|
|
|
key: ${{ secrets.SSH_KEY_DEPLOY_TO_WIZARD }}
|
|
|
|
script: |
|
|
|
|
chmod +x ~/homelab/wizard/config/*.sh
|
2024-02-14 11:22:15 -08:00
|
|
|
- name: Apply configuration
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ vars.SSH_HOST_IP_WIZARD }} # this is a LAN IP
|
|
|
|
username: ${{ vars.SSH_USERNAME_WIZARD }}
|
|
|
|
key: ${{ secrets.SSH_KEY_DEPLOY_TO_WIZARD }}
|
|
|
|
script: |
|
|
|
|
cd ~/homelab/wizard/config
|
2024-02-14 11:47:23 -08:00
|
|
|
/bin/vbash configure.sh
|
|
|
|
- name: Show configuration
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ vars.SSH_HOST_IP_WIZARD }} # this is a LAN IP
|
|
|
|
username: ${{ vars.SSH_USERNAME_WIZARD }}
|
|
|
|
key: ${{ secrets.SSH_KEY_DEPLOY_TO_WIZARD }}
|
2024-02-14 13:00:58 -08:00
|
|
|
script: |
|
2024-02-14 13:09:43 -08:00
|
|
|
cd ~/homelab/wizard/config
|
|
|
|
/bin/vbash show-config.sh
|