feat: using act runner with ansible
All checks were successful
deploy host / Deploy (push) Successful in 12s
Portainer stack nginx / deploy (push) Successful in 1s
Portainer stack wyoming / deploy (push) Successful in 1s
Portainer stack zigbee2mqtt / deploy (push) Successful in 1s

This commit is contained in:
2024-11-02 20:58:31 +00:00
parent 3d4a6455f8
commit 662da99ef0
6 changed files with 13 additions and 16 deletions

2
.actrc Normal file
View File

@@ -0,0 +1,2 @@
-P vlan-casa_continous-deploy=git.limbosolutions.com/kb/gitea/act-runner_ansible:0.2.11-dev
-W .gitea

View File

@@ -6,28 +6,22 @@ on:
- ".gitea/workflows/**host**.yml"
jobs:
Deploy:
runs-on: "homesrv-deploy"
runs-on: "vlan-casa_continous-deploy"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: setup ssh
run: |
echo "${{ secrets.HOST_ANSIBLE_PRIVATE_KEY }}" > ${GITHUB_WORKSPACE}/ssh-key &&
chmod 600 ${GITHUB_WORKSPACE}/ssh-key
- name: Run Ansible Playbook
run: |
docker run --rm \
-e ANSIBLE_PRIVATE_KEY_FILE="${GITHUB_WORKSPACE}/ssh-key" \
-e ANSIBLE_REMOTE_USER="${{ secrets.HOST_ANSIBLE_REMOTE_USER }}" \
-e ANSIBLE_INVENTORY="${{ secrets.HOST_ANSIBLE_INVENTORY }}" \
-e ANSIBLE_PROJECT_DIR="${GITHUB_WORKSPACE}/ansible" \
-e ANSIBLE_HOST_KEY_CHECKING=false \
-e ANSIBLE_BECOME_PASS=${{ secrets.HOST_ANSIBLE_BECOME_PASS }} \
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
git.limbosolutions.com/kb/ansible \
run: |
cd ${GITHUB_WORKSPACE}
export ANSIBLE_HOST_KEY_CHECKING=False; ansible-playbook ansible/site.yml --private-key ${GITHUB_WORKSPACE}/ssh-key

View File

@@ -6,7 +6,7 @@ on:
- ".gitea/workflows/**nginx**.yml"
jobs:
deploy:
runs-on: "homesrv-deploy"
runs-on: "vlan-casa_continous-deploy"
steps:
- name: Portainer stack nginx webhook
run: |

View File

@@ -6,8 +6,8 @@ on:
- ".gitea/workflows/**wyoming**.yml"
jobs:
deploy:
runs-on: "homesrv-deploy"
runs-on: "vlan-casa_continous-deploy"
steps:
- name: Portainer stack wyoming webhook
run: |
curl -X POST "${{secrets.PORTAINER_WYOMING_WEBHOOK_URL}}"
curl -X POST "${{secrets.PORTAINER_WYOMING_WEBHOOK_URL}}" --insecure

View File

@@ -6,7 +6,7 @@ on:
- ".gitea/workflows/**zigbee2mqtt**.yml"
jobs:
deploy:
runs-on: "homesrv-deploy"
runs-on: "vlan-casa_continous-deploy"
steps:
- name: Portainer stack zigbee2mqtt webhook
run: |

1
.gitignore vendored
View File

@@ -8,4 +8,5 @@ services/zigbee2mqtt/volumes/*
.vscode/settings.json
gitignore/*
**.local
.secrets
ansible/inventory.yml