33 lines
824 B
YAML
33 lines
824 B
YAML
name: Deploy to Production
|
|
|
|
on:
|
|
workflow_call:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: main
|
|
|
|
- name: Install Ansible and collections
|
|
run: |
|
|
pip install --break-system-packages ansible
|
|
ansible-galaxy collection install ansible.posix community.docker
|
|
|
|
- name: Set up SSH key
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.SRV_SSH_KEY }}" > ~/.ssh/deploy_key
|
|
chmod 600 ~/.ssh/deploy_key
|
|
|
|
- name: Run Ansible playbook
|
|
run: |
|
|
ansible-playbook \
|
|
-i infra/production/hosts.ini \
|
|
-e "ansible_ssh_private_key_file=~/.ssh/deploy_key" \
|
|
infra/production/site/deploy-playbook.yml
|