Compare commits
No commits in common. "9b933687a3b99e289a4bf0c04f65e3519c1c5ad9" and "9794879495e35dacc75ae2454cf86f646eeb77e8" have entirely different histories.
9b933687a3
...
9794879495
1 changed files with 0 additions and 54 deletions
|
@ -1,54 +0,0 @@
|
|||
name: Deploy to Hosts
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Detect modified folders
|
||||
id: detect-changes
|
||||
run: |
|
||||
folders=$(git diff-tree --no-commit-id --name-only -r "${{ github.event.pull_request.merge_commit_sha }}" | cut -d/ -f1 | sort | uniq)
|
||||
echo "Modified folders: $folders"
|
||||
echo "::set-output name=folders::$folders"
|
||||
|
||||
- name: Determine target host
|
||||
id: determine-host
|
||||
run: |
|
||||
folder=${{ steps.detect-changes.outputs.folders }}
|
||||
case $folder in
|
||||
arrs)
|
||||
echo "::set-output name=target_host::${{ secrets.ARRS_IP }}"
|
||||
;;
|
||||
ag_main)
|
||||
echo "::set-output name=target_host::${{ secrets.AGMAIN_IP }}"
|
||||
;;
|
||||
downloaders)
|
||||
echo "::set-output name=target_host::${{ secrets.DOWNLOADERS_IP }}"
|
||||
;;
|
||||
# Add cases for other folders/hosts
|
||||
*)
|
||||
echo "Unknown folder: $folder"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
echo "::set-output name=folder::$folder"
|
||||
|
||||
- name: Trigger AWX Job
|
||||
run: |
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" \
|
||||
-d '{
|
||||
"extra_vars": {
|
||||
"target_host": "${{ steps.determine-host.outputs.target_host }}",
|
||||
"folder": "${{ steps.determine-host.outputs.folder }}"
|
||||
}
|
||||
}' \
|
||||
"https://awx.mafyuh.xyz/api/v2/job_templates/13/github/"
|
Reference in a new issue