Product tags now come from the role directory, and edits to the CI scripts no longer redeploy every machine. Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
name: ansible-rus-central
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'ansible/roles/rus-central/**'
|
|
- 'ansible/roles/host/**'
|
|
- 'ansible/playbooks/rus-central.yml'
|
|
- 'ansible/playbooks/host.yml'
|
|
- 'ansible/playbooks/site.yml'
|
|
- 'ansible/inventories/prod/hosts.yml'
|
|
- 'ansible/inventories/prod/host_vars/rus-central.yml'
|
|
- 'ansible/inventories/prod/group_vars/**'
|
|
workflow_dispatch:
|
|
inputs:
|
|
letsencrypt_email:
|
|
description: Почта Let's Encrypt, если её нужно задать отдельно от group_vars
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: homelab
|
|
container:
|
|
image: homelab-ansible:latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Деплой rus-central
|
|
env:
|
|
INFISICAL_CLIENT_ID: ${{ secrets.INFISICAL_CLIENT_ID }}
|
|
INFISICAL_CLIENT_SECRET: ${{ secrets.INFISICAL_CLIENT_SECRET }}
|
|
INPUT_LETSENCRYPT_EMAIL: ${{ inputs.letsencrypt_email }}
|
|
run: |
|
|
set -eu
|
|
rm -rf "${HOME}/homelab-infra"
|
|
git clone http://192.168.1.217: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" rus-central "${{ github.event_name }}" "${{ github.event.before }}" "${{ github.sha }}"
|