From 7d891f083967ba320f17aae3fd000fecc0f734ac Mon Sep 17 00:00:00 2001 From: mafyuh Date: Sun, 9 Jun 2024 04:36:54 +0000 Subject: [PATCH] Update .forgejo/workflows/CD.yml --- .forgejo/workflows/CD.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.forgejo/workflows/CD.yml b/.forgejo/workflows/CD.yml index 151e123..32715e4 100644 --- a/.forgejo/workflows/CD.yml +++ b/.forgejo/workflows/CD.yml @@ -7,28 +7,17 @@ on: jobs: deploy: - runs-on: docker + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up SSH agent - uses: webfactory/ssh-agent@v0.5.3 - with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - - name: Detect modified folders - id: detect-changes - run: | - # List all modified files and filter unique folder names - folders=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | cut -d/ -f1 | sort | uniq) - echo "Modified folders: $folders" - echo "::set-output name=folders::$folders" + - name: Configure SSH Key + run: echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa - name: Deploy to Hosts - if: steps.detect-changes.outputs.folders != '' run: | - for folder in ${{ steps.detect-changes.outputs.folders }} + for folder in $(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | cut -d/ -f1 | sort | uniq) do case $folder in arrs)