This repository has been archived on 2024-07-30. You can view files and clone it, but cannot push or open issues or pull requests.
Auto-Homelab/.forgejo/workflows/CD.yml
mafyuh 961330906b
All checks were successful
Continuous Deployment / deploy (push) Successful in 3s
Update .forgejo/workflows/CD.yml
2024-06-09 05:08:48 +00:00

29 lines
677 B
YAML

name: Continuous Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure SSH Key
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Deploy to Hosts
run: |
for folder in $(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | cut -d/ -f1 | sort | uniq)
do
echo "Deploying to $folder"
./scripts/deploy.sh $folder
done
echo "Deployment for $folder completed successfully"