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,12 +6,11 @@ on:
|
|||||||
- ".gitea/workflows/**host**.yml"
|
- ".gitea/workflows/**host**.yml"
|
||||||
jobs:
|
jobs:
|
||||||
Deploy:
|
Deploy:
|
||||||
runs-on: "homesrv-deploy"
|
runs-on: "vlan-casa_continous-deploy"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
|
||||||
- name: setup ssh
|
- name: setup ssh
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.HOST_ANSIBLE_PRIVATE_KEY }}" > ${GITHUB_WORKSPACE}/ssh-key &&
|
echo "${{ secrets.HOST_ANSIBLE_PRIVATE_KEY }}" > ${GITHUB_WORKSPACE}/ssh-key &&
|
||||||
@@ -19,15 +18,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Run Ansible Playbook
|
- name: Run Ansible Playbook
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
cd ${GITHUB_WORKSPACE}
|
||||||
-e ANSIBLE_PRIVATE_KEY_FILE="${GITHUB_WORKSPACE}/ssh-key" \
|
export ANSIBLE_HOST_KEY_CHECKING=False; ansible-playbook ansible/site.yml --private-key ${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 \
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
- ".gitea/workflows/**nginx**.yml"
|
- ".gitea/workflows/**nginx**.yml"
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: "homesrv-deploy"
|
runs-on: "vlan-casa_continous-deploy"
|
||||||
steps:
|
steps:
|
||||||
- name: Portainer stack nginx webhook
|
- name: Portainer stack nginx webhook
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ on:
|
|||||||
- ".gitea/workflows/**wyoming**.yml"
|
- ".gitea/workflows/**wyoming**.yml"
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: "homesrv-deploy"
|
runs-on: "vlan-casa_continous-deploy"
|
||||||
steps:
|
steps:
|
||||||
- name: Portainer stack wyoming webhook
|
- name: Portainer stack wyoming webhook
|
||||||
run: |
|
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"
|
- ".gitea/workflows/**zigbee2mqtt**.yml"
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: "homesrv-deploy"
|
runs-on: "vlan-casa_continous-deploy"
|
||||||
steps:
|
steps:
|
||||||
- name: Portainer stack zigbee2mqtt webhook
|
- name: Portainer stack zigbee2mqtt webhook
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,4 +8,5 @@ services/zigbee2mqtt/volumes/*
|
|||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
gitignore/*
|
gitignore/*
|
||||||
**.local
|
**.local
|
||||||
|
.secrets
|
||||||
ansible/inventory.yml
|
ansible/inventory.yml
|
||||||
|
|||||||
Reference in New Issue
Block a user