Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a cleanup cron job #2059

Merged
merged 2 commits into from
Apr 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/nightly-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dispatch to the consul-k8s-workflows with a nightly cron
name: nightly-cleanup
on:
schedule:
# * is a special character in YAML so you have to quote this string
# Run nightly at 12PM UTC/8AM EST/5AM PST
- cron: '0 12 * * *'

# these should be the only settings that you will ever need to change
env:
CONSUL_IMAGE: "not used"
BRANCH: ${{ github.ref_name }}
CONTEXT: "nightly"

jobs:
cleanup:
name: cleanup
runs-on: ubuntu-latest
steps:
- uses: benc-uk/workflow-dispatch@v1.2.2
name: cleanup
with:
workflow: cleanup.yml
repo: hashicorp/consul-k8s-workflows
ref: main
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
inputs: '{ "context":"${{ env.CONTEXT }}", "repository":"${{ github.repository }}", "branch":"${{ env.BRANCH }}", "sha":"${{ github.sha }}", "token":"${{ secrets.ELEVATED_GITHUB_TOKEN }}", "consul-image":"${{ env.CONSUL_IMAGE }}" }'