generated from helmut/template
40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
name: Remote Deploy to Windows
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gitea/runner-images:ubuntu-latest
|
|
options: --user root --add-host localhost:192.168.14.190
|
|
|
|
steps:
|
|
- name: Fix Networking and Environment
|
|
run: |
|
|
echo "192.168.14.190 localhost" >> /etc/hosts
|
|
|
|
echo "HOME=/root" >> $GITHUB_ENV
|
|
echo "ACTIONS_CACHE_DIR=/tmp/cache" >> $GITHUB_ENV
|
|
mkdir -p /tmp/cache
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up SSH Key
|
|
run: |
|
|
mkdir -p /root/.ssh
|
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > /root/.ssh/id_ed25519
|
|
chmod 600 /root/.ssh/id_ed25519
|
|
|
|
cat <<EOF > /root/.ssh/config
|
|
Host *
|
|
StrictHostKeyChecking no
|
|
UserKnownHostsFile /dev/null
|
|
EOF
|
|
|
|
- name: Run Ansible Playbook
|
|
run: |
|
|
cd ansible
|
|
ansible-playbook -i inventory.ini playbook.yml --private-key /root/.ssh/id_ed25519 |