Initial commit
This commit is contained in:
63
.gitea/workflows/deploy.yml
Normal file
63
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,63 @@
|
||||
name: Ansible Playbook lint & deploy
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
ansible-lint:
|
||||
runs-on: imgbuilder
|
||||
container:
|
||||
image: gitea.konchin.com/system/ansible-image
|
||||
credentials:
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Ansible Lint
|
||||
run: |
|
||||
ansible-lint roles/ playbooks/
|
||||
|
||||
run-ansible-mongo:
|
||||
needs: ansible-lint
|
||||
runs-on: imgbuilder
|
||||
container:
|
||||
image: gitea.konchin.com/system/ansible-image
|
||||
credentials:
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
options: --dns 192.168.68.254 --dns-search konchin.com --dns-option ndots:15
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup ssh key
|
||||
run: |
|
||||
printf '%s\n' "${{ secrets.ANSIBLE_ED25519 }}" > ~/.ssh/id_ed25519
|
||||
chmod 0600 ~/.ssh/id_ed25519
|
||||
- name: Setup ssh pubkey
|
||||
run: |
|
||||
printf '%s\n' "${{ secrets.ANSIBLE_ED25519_PUB }}" > ~/.ssh/id_ed25519_pub
|
||||
|
||||
- name: Run playbook
|
||||
run: ansible-playbook playbooks/mongo_users.yml
|
||||
|
||||
run-ansible-postgres:
|
||||
needs: ansible-lint
|
||||
runs-on: imgbuilder
|
||||
container:
|
||||
image: gitea.konchin.com/system/ansible-image
|
||||
credentials:
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
options: --dns 192.168.68.254 --dns-search konchin.com --dns-option ndots:15
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup ssh key
|
||||
run: |
|
||||
printf '%s\n' "${{ secrets.ANSIBLE_ED25519 }}" > ~/.ssh/id_ed25519
|
||||
chmod 0600 ~/.ssh/id_ed25519
|
||||
- name: Setup ssh pubkey
|
||||
run: |
|
||||
printf '%s\n' "${{ secrets.ANSIBLE_ED25519_PUB }}" > ~/.ssh/id_ed25519_pub
|
||||
|
||||
- name: Run playbook
|
||||
run: ansible-playbook playbooks/postgres_users.yml
|
||||
Reference in New Issue
Block a user