38 lines
1.5 KiB
YAML
38 lines
1.5 KiB
YAML
---
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo "${{github.sha}}"
|
|
# - name: Checkout cuqmbr/homelab repository
|
|
# run: git clone https://git.cuqmbr.xyz/cuqmbr/homelab.git --depth 1 --branch main --single-branch
|
|
# - name: Setup ansible
|
|
# run: apt-get update && apt-get install ansible-core -y
|
|
# - name: Add SSH key
|
|
# env:
|
|
# SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
|
# run: |
|
|
# mkdir -p ~/.ssh
|
|
# echo "${{secrets.ANSIBLE_SSH_KEY}}" > ~/.ssh/key
|
|
# chmod 600 ~/.ssh/key
|
|
# ssh-agent -a $SSH_AUTH_SOCK > /dev/null
|
|
# ssh-add ~/.ssh/key
|
|
# # Without the workaroud can't establish connection to targeted server
|
|
# - name: Connect directly to bastion
|
|
# env:
|
|
# SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
|
# run: |
|
|
# ssh -o StrictHostKeyChecking=no gitea-actions@bastion.cuqmbr.home 'cat /etc/hostname'
|
|
# - name: Run ansible playbook
|
|
# env:
|
|
# SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
|
# run: |
|
|
# cd ./homelab/ansible
|
|
# ansible-playbook -u gitea-actions --ssh-common-args "-o StrictHostKeyChecking=no -o ProxyCommand='ssh -p 22 -W %h:%p -q gitea-actions@bastion.cuqmbr.home'" --private-key ~/.ssh/key -b --become-method doas --start-at-task 'Install hugo deb package from github.' --extra-vars "hugo_git_repo=${{github.repositoryUrl}} hugo_git_commit=${{github.sha}}" -i inventories/dev/hosts.yml 20_main_page.yml
|