Skip to content

Use debops.cron role to configure cron jobs #305

Use debops.cron role to configure cron jobs

Use debops.cron role to configure cron jobs #305

---
name: Deploy to Production
on:
push:
branches:
- main
paths-ignore:
- README.md
schedule:
- cron: '10 3 */2 * *'
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
jobs:
ansible-lint:
name: Ansible Lint
uses: amedee/ansible-servers/.github/workflows/ansible-lint.yml@main
shellcheck:
name: ShellCheck
permissions:
contents: read
uses: amedee/ansible-servers/.github/workflows/shellcheck.yml@main
ansible-playbook:
name: Ansible Playbook
runs-on: ubuntu-latest
needs: [ansible-lint, shellcheck]
strategy:
matrix:
host: [box.vangasse.eu, amedee.be]
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
- name: Checkout code
uses: actions/checkout@v4
- name: Set environment variables
run: |
echo "ANSIBLE_CONFIG=ansible.cfg" >> $GITHUB_ENV
echo "ANSIBLE_STDOUT_CALLBACK=yaml" >> $GITHUB_ENV
- name: Install Ansible Galaxy collections
run: ansible-galaxy install -r requirements.yml
- name: Create controlmasters directory
run: mkdir --parents ~/.ssh/controlmasters
- name: Deploy changes to servers
uses: dawidd6/action-ansible-playbook@c97d71562fcba83cc1ea0602d5a77013427f7571 # v2.8.0
with:
playbook: playbooks/site.yml
key: ${{secrets.SSH_PRIVATE_KEY}}
vault_password: ${{secrets.VAULT_PASSWORD}}
options: |
--inventory inventory/production
--limit ${{ matrix.host }}
- name: Archive Ansible log
uses: actions/upload-artifact@v4
with:
name: ansible-${{ matrix.host }}.log
path: ~/.ansible/ansible.log
compression-level: 9
overwrite: true
- name: checkrun-timechart
uses: urcomputeringpal/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
SUMMARY: "true"