Skip to content

Server Maintenance #255

Server Maintenance

Server Maintenance #255

Workflow file for this run

name: Server Maintenance
on:
schedule:
- cron: "0 1 * * *"
push:
branches:
- 'main'
jobs:
server_maintenance:
runs-on: self-hosted
permissions: write-all
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Configure Environment Variables
id: config_inventory
run: |
sed -i "s/PASSWORD/${{ secrets.HOMELAB_PASSWORD }}/g" ./inventory.yml
sed -i "s/USER/${{ secrets.USER }}/g" ./inventory.yml
sed -i "s/R510/${{ secrets.R510 }}/g" ./inventory.yml
sed -i "s/R710/${{ secrets.R710 }}/g" ./inventory.yml
sed -i "s/R820/${{ secrets.R820 }}/g" ./inventory.yml
sed -i "s/RPI4/${{ secrets.RPI4 }}/g" ./inventory.yml
sed -i "s#directory=/home/ansible/Development#directory=${{ secrets.DIRECTORY }}#g" ./Dockerfile
- name: Build Image
id: build_image
run: docker build -t server_automation:latest .
- name: Run Playbook
id: run_playbook
run: docker run -i server_automation:latest