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 c8daf2ac53
All checks were successful
Continuous Deployment / deploy (push) Successful in 3s
Update .forgejo/workflows/CD.yml
2024-06-09 04:51:41 +00:00

27 lines
613 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