37 lines
814 B
YAML
37 lines
814 B
YAML
name: Deploy to ras-dan-01
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
tags: [shell]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Ansible
|
|
run: |
|
|
python3 -m pip install --user ansible
|
|
ansible-galaxy collection install community.docker
|
|
|
|
- name: Setup Ansible Vault
|
|
run: |
|
|
mkdir -p ~/.ansible
|
|
echo "${{ secrets.VAULT_PASSWORD }}" > ~/.ansible/.vault-pass
|
|
chmod 600 ~/.ansible/.vault-pass
|
|
|
|
- name: Setup SSH key
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.ANSIBLE_PRIVATE_KEY }}" > ~/.ssh/ansible
|
|
chmod 600 ~/.ssh/ansible
|
|
|
|
- name: Run Ansible Playbook
|
|
run: ansible-playbook deploy_remote.yml
|