split action buid-runner from host
Some checks failed
deploy host / Deploy (push) Successful in 15s
deploy host / build-runner (push) Failing after 7s

This commit is contained in:
2024-09-01 04:36:49 +01:00
parent 103039e049
commit 2bf42fda63
2 changed files with 28 additions and 27 deletions

View File

@@ -1,28 +1,11 @@
name: deploy host
on:
push:
paths-ignore:
- "services/**"
- "docs/**"
- ".gitea/workflows/**services**.yml"
paths:
- "ansible/**"
- ".gitea/workflows/**host**.yml"
jobs:
setup-runner:
runs-on: homesrv01
container:
image: catthehacker/ubuntu:act-latest
volumes:
- workspace:/workspace
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: build git runner
shell: bash
run: |
docker build ${{gitea.workspace}}/services/git-runner --tag homesrv/git-runner
ansible-playbook:
Deploy:
runs-on: homesrv01
container:
image: homesrv/git-runner
@@ -36,15 +19,13 @@ jobs:
echo "${{secrets.SSH_PRIVATE_KEY}}" > ~/.ssh/private_key.pem
chmod 600 ~/.ssh/private_key.pem
- name: get version
run: |
lsb_release -a
- name: Run Ansible Playbook
env:
ANSIBLE_HOST_KEY_CHECKING: False
ANSIBLE_BECOME_PASS: ${{secrets.ANSIBLE_BECOME_PASS}}
run: |
ansible-playbook -i ${{secrets.SERVER_ADDRESS}}, ${{gitea.workspace}}/ansible/site.yml --private-key ~/.ssh/private_key.pem -u ${{secrets.ANSIBLE_USER}}
- name: get version
run: |
lsb_release -a

View File

@@ -0,0 +1,20 @@
name: deploy host
on:
push:
paths:
- "services/git-runner/*"
- ".gitea/workflows/**git-runner**.yml"
jobs:
build-runner:
runs-on: homesrv01
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: build git runner
shell: bash
run: |
docker build ${{gitea.workspace}}/services/git-runner --tag homesrv/git-runner