Add GitHub Actions Workflow for maintaining & deploying production hosts
The workflow runs on a schedule and can also be triggered manually.
This commit is contained in:
24
.github/workflows/deploy-production-hosts.yaml
vendored
Normal file
24
.github/workflows/deploy-production-hosts.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Maintain & Deploy Production Hosts
|
||||
on:
|
||||
schedule:
|
||||
# Run Wednesday and Friday (the days on which I (Julian) usually work) at
|
||||
# 04:00.
|
||||
- cron: "0 4 * * 3,5"
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
Run-Everything-Playbook:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup .ssh
|
||||
run: |
|
||||
mkdir -p $HOME/.ssh
|
||||
chmod 700 $HOME/.ssh
|
||||
echo "${{ secrets.ANSIBLE_INFRA_SSH_DEPLOY_KEY }}" > $HOME/.ssh/id_ed25519
|
||||
chmod 400 $HOME/.ssh/id_ed25519
|
||||
echo "${{ vars.ANSIBLE_INFRA_SSH_KNOWN_HOSTS }}" > $HOME/.ssh/known_hosts
|
||||
- name: Install dependencies
|
||||
run: ansible-galaxy install -r requirements.yml -f
|
||||
- name: Run playbook
|
||||
run: ansible-playbook -l Production_Hosts playbooks/everything.yaml
|
||||
Reference in New Issue
Block a user