feat: using act runner with ansible
This commit is contained in:
2
.actrc
Normal file
2
.actrc
Normal file
@@ -0,0 +1,2 @@
|
||||
-P vlan-casa_continous-deploy=git.limbosolutions.com/kb/gitea/act-runner_ansible:0.2.11-dev
|
||||
-W .gitea
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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: |
|
||||
|
||||
@@ -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
|
||||
@@ -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
1
.gitignore
vendored
@@ -8,4 +8,5 @@ services/zigbee2mqtt/volumes/*
|
||||
.vscode/settings.json
|
||||
gitignore/*
|
||||
**.local
|
||||
.secrets
|
||||
ansible/inventory.yml
|
||||
|
||||
Reference in New Issue
Block a user