Skip to content

Adding a EKS Purge Job, removing the AKS job, making the frequency once a day for test job #4

Adding a EKS Purge Job, removing the AKS job, making the frequency once a day for test job

Adding a EKS Purge Job, removing the AKS job, making the frequency once a day for test job #4

name: Purge AWS EKS Clusters
on:
schedule:
# Runs every 6 hours
- cron: "0 0,6 * * *"
pull_request:
types: [opened, synchronize, reopened]
branches:
- v*.*
- edge
env:
GH_TOKEN: ${{ github.token }}
AWS_REGION: us-west-2
jobs:
purge_rds_snapshots:
name: Purge AWS EKS Clusters
runs-on: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
run: |
pip install boto3
- name: Delete old EKS clusters
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
run: python .github/scripts/delete-old-eks-clusters.py
- name: Create GitHub issue on failure
if: ${{ failure() && github.event_name != 'pull_request' }}
run: |
gh issue create --title "Purge AWS EKS Clusters workflow failed" \
--body "Test failed on ${{ github.repository }}. See [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details." \
--repo ${{ github.repository }}