Delete Coveo Resources #666
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: 'Delete Coveo Resources' | |
on: | |
workflow_dispatch: | |
schedule: | |
# At 05:00 UTC on every day-of-week from Tuesday through Friday. | |
- cron: '0 5 * * 2-5' | |
jobs: | |
delete-resources: | |
runs-on: ubuntu-20.04 | |
environment: Cleaning | |
env: | |
ORG_ID: ${{ secrets.ORG_ID }} | |
PLATFORM_API_KEY: ${{ secrets.PLATFORM_API_KEY }} | |
PLATFORM_ENV: 'stg' | |
PLATFORM_USER_NAME: ${{ secrets.PLATFORM_USER_NAME }} | |
PLATFORM_USER_PASSWORD: ${{ secrets.PLATFORM_USER_PASSWORD }} | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3 | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 | |
with: | |
cache: 'npm' | |
node-version-file: '.nvmrc' | |
- run: npm ci | |
- name: Resume org | |
timeout-minutes: 30 | |
if: cancelled() || failure() || success() | |
run: node ./scripts/cleaning/wake-org.mjs || true | |
- name: Delete test API keys | |
timeout-minutes: 30 | |
if: cancelled() || failure() || success() | |
run: node ./scripts/cleaning/delete-api-keys.js --olderThan 1d | |
- name: Delete test orgs | |
timeout-minutes: 30 | |
if: cancelled() || failure() || success() | |
run: | | |
Xvfb :1 -screen 0 1024x768x16 & sleep 1 | |
xdg-settings set default-web-browser google-chrome.desktop | |
node -r ts-node/register/transpile-only packages/cli-e2e/cleaning.ts | |
node ./scripts/cleaning/delete-orgs.js --olderThan 1d | |
env: | |
DISPLAY: ':1' | |
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 | |
if: cancelled() || failure() || success() | |
with: | |
name: cleaning-artifacts | |
path: ./packages/cli-e2e/artifacts | |
# - name: Notify in case of failure | |
# if: failure() | |
# run: curl --request POST --url ${{ secrets.SLACK_WEBHOOK }} |