generated from helmut/template
47 lines
1.3 KiB
YAML
47 lines
1.3 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: Manual Checkout
|
|
run: |
|
|
git clone http://192.168.14.190:3000/helmut/FreeFileSync.git .
|
|
git checkout ${{ github.sha }}
|
|
|
|
- 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: Install Ansible
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y ansible
|
|
|
|
- name: Run Ansible Playbook
|
|
run: |
|
|
cd ansible
|
|
ansible-playbook -i inventory.ini playbook.yml --private-key /root/.ssh/id_ed25519 |