Files
homelab-infra/.gitea/workflows/ansible-opnsense.yml
T

36 lines
1.1 KiB
YAML

name: ansible-opnsense
on:
push:
branches:
- main
paths:
- 'ansible/roles/opnsense/**'
- 'ansible/playbooks/opnsense.yml'
- 'ansible/inventories/prod/host_vars/opnsense.yml'
- 'ansible/inventories/prod/group_vars/**'
workflow_dispatch:
jobs:
deploy:
runs-on: homelab
container:
image: homelab-ansible:latest
timeout-minutes: 30
steps:
- name: Деплой opnsense
env:
INFISICAL_CLIENT_ID: ${{ secrets.INFISICAL_CLIENT_ID }}
INFISICAL_CLIENT_SECRET: ${{ secrets.INFISICAL_CLIENT_SECRET }}
run: |
set -eu
rm -rf "${HOME}/homelab-infra"
git clone http://192.168.1.105:3000/karpenok/homelab-infra.git "${HOME}/homelab-infra"
sha="${GITHUB_SHA:-${GITEA_SHA:-}}"
if [ -n "${sha}" ]; then
git -C "${HOME}/homelab-infra" checkout "${sha}"
fi
chmod -R go-w "${HOME}/homelab-infra"
exec bash "${HOME}/homelab-infra/ansible/ci/deploy-machine.sh" opnsense "${{ github.event_name }}" "${{ github.event.before }}" "${{ github.sha }}"