preview-env-clean #377
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: preview-env-clean | |
on: | |
schedule: | |
- cron: 0 6,22 * * * | |
workflow_call: | |
inputs: | |
pull-request: | |
description: | | |
Limit cleanup to a single pull request (number) and a minimal mode. | |
Useful for quickly eliminating inconsistencies while waiting for the full cleanup cycle to run. | |
required: false | |
type: number | |
secrets: | |
VAULT_ADDR: | |
required: true | |
VAULT_ROLE_ID: | |
required: true | |
VAULT_SECRET_ID: | |
required: true | |
workflow_dispatch: | |
jobs: | |
preview-env-clean: | |
concurrency: | |
group: ${{ github.workflow }}-${{ inputs.pull-request }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Generate a GitHub token | |
id: github-token | |
uses: camunda/infra-global-github-actions/generate-github-app-token-from-vault-secrets@main | |
with: | |
github-app-id-vault-key: GITHUB_PREVIEW_ENVIRONMENTS_APP_ID | |
github-app-id-vault-path: secret/data/products/connectors/ci/common | |
github-app-private-key-vault-key: GITHUB_PREVIEW_ENVIRONMENTS_APP_PRIVATE_KEY | |
github-app-private-key-vault-path: secret/data/products/connectors/ci/common | |
vault-auth-method: approle | |
vault-auth-role-id: ${{ secrets.VAULT_ROLE_ID }} | |
vault-auth-secret-id: ${{ secrets.VAULT_SECRET_ID}} | |
vault-url: ${{ secrets.VAULT_ADDR }} | |
- uses: camunda/infra-global-github-actions/preview-env/clean@main | |
with: | |
labels: deploy-preview | |
pull-request: ${{ inputs.pull-request }} | |
token: ${{ steps.github-token.outputs.token }} | |
ttl: 21d | |
warning-ttl: 14d |