split action buid-runner from host
This commit is contained in:
@@ -1,28 +1,11 @@
|
|||||||
name: deploy host
|
name: deploy host
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths-ignore:
|
paths:
|
||||||
- "services/**"
|
- "ansible/**"
|
||||||
- "docs/**"
|
- ".gitea/workflows/**host**.yml"
|
||||||
- ".gitea/workflows/**services**.yml"
|
|
||||||
jobs:
|
jobs:
|
||||||
setup-runner:
|
Deploy:
|
||||||
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:
|
|
||||||
runs-on: homesrv01
|
runs-on: homesrv01
|
||||||
container:
|
container:
|
||||||
image: homesrv/git-runner
|
image: homesrv/git-runner
|
||||||
@@ -36,15 +19,13 @@ jobs:
|
|||||||
echo "${{secrets.SSH_PRIVATE_KEY}}" > ~/.ssh/private_key.pem
|
echo "${{secrets.SSH_PRIVATE_KEY}}" > ~/.ssh/private_key.pem
|
||||||
chmod 600 ~/.ssh/private_key.pem
|
chmod 600 ~/.ssh/private_key.pem
|
||||||
|
|
||||||
|
|
||||||
- name: get version
|
|
||||||
run: |
|
|
||||||
lsb_release -a
|
|
||||||
|
|
||||||
|
|
||||||
- name: Run Ansible Playbook
|
- name: Run Ansible Playbook
|
||||||
env:
|
env:
|
||||||
ANSIBLE_HOST_KEY_CHECKING: False
|
ANSIBLE_HOST_KEY_CHECKING: False
|
||||||
ANSIBLE_BECOME_PASS: ${{secrets.ANSIBLE_BECOME_PASS}}
|
ANSIBLE_BECOME_PASS: ${{secrets.ANSIBLE_BECOME_PASS}}
|
||||||
run: |
|
run: |
|
||||||
ansible-playbook -i ${{secrets.SERVER_ADDRESS}}, ${{gitea.workspace}}/ansible/site.yml --private-key ~/.ssh/private_key.pem -u ${{secrets.ANSIBLE_USER}}
|
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
|
||||||
20
.gitea/workflows/services.git-runner.yml
Normal file
20
.gitea/workflows/services.git-runner.yml
Normal 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
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user