From 6671faf4d7ee86f64a703eab986f6830b96d36ed Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Tue, 13 Feb 2024 20:54:49 -0800 Subject: [PATCH] Add deploy workflow for druid --- .gitea/workflows/deploy-to-druid.yml | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .gitea/workflows/deploy-to-druid.yml diff --git a/.gitea/workflows/deploy-to-druid.yml b/.gitea/workflows/deploy-to-druid.yml new file mode 100644 index 0000000..86cd9c0 --- /dev/null +++ b/.gitea/workflows/deploy-to-druid.yml @@ -0,0 +1,33 @@ +name: Deploy to Druid +run-name: ${{ gitea.actor }} deploying +on: + push: + paths: + - 'druid/**' + +jobs: + Deploy-to-Druid: + runs-on: druid + steps: + - name: Pull latest code onto Druid via SSH + uses: appleboy/ssh-action@master + with: + host: ${{ vars.SSH_HOST_IP_DRUID }} # this is a LAN IP + username: ${{ vars.SSH_USERNAME_DRUID }} + key: ${{ secrets.SSH_KEY_DEPLOY_TO_DRUID }} + script: | + cd ~/homelab + git pull + - name: Validate compose configs + uses: appleboy/ssh-action@master + with: + host: ${{ vars.SSH_HOST_IP_DRUID }} # this is a LAN IP + username: ${{ vars.SSH_USERNAME_DRUID }} + key: ${{ secrets.SSH_KEY_DEPLOY_TO_DRUID }} + script: | + for stack in /home/$USER/homelab/druid/config/* + do cd $stack && + echo "===== Validating $(basename $PWD) =====" && + docker compose config > /dev/null + done +