Skip to content

Commit

Permalink
chore(ci): add cleanup workflow update notification
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeniy Frolov <[email protected]>
  • Loading branch information
Fral738 committed Dec 17, 2024
1 parent 0ef364f commit 9bfb84b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: cleanup

on:
workflow_call:
inputs:
werfDir:
required: false
type: string
withoutKube:
required: false
type: string
werfRepo:
required: false
type: string
secrets:
cleanupToken:
description: "cleanup token"
required: true
kubeconfig:
required: false
githubToken:
required: true

defaults:
run:
shell: bash

jobs:
cleanup:
name: cleanup
runs-on: ubuntu-latest-16-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/install@v2
with:
channel: alpha

- name: Cleanup
run: |
. $(werf ci-env github --as-file)
werf cleanup
env:
WERF_DIR: ${{ inputs.werfDir }}
WERF_WITHOUT_KUBE: ${{ inputs.withoutKube }}
GITHUB_TOKEN: ${{ secrets.githubToken }}
WERF_REPO_GITHUB_TOKEN: ${{ secrets.cleanupToken }}
WERF_KUBE_CONFIG_BASE64: ${{ secrets.kubeconfig }}
WERF_REPO: ${{ inputs.werfRepo }}
2 changes: 1 addition & 1 deletion .github/workflows/notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
Упавшие джобы:
${{ steps.failed_jobs.outputs.failed }}
- if: env.WORKFLOW_CONCLUSION == 'success'
- if: "env.WORKFLOW_CONCLUSION == 'success' && ! startsWith(github.ref, 'refs/pull/') && ! github.event_name == 'workflow_dispatch'"
name: Success notify
uses: mattermost/action-mattermost-notify@master
with:
Expand Down

0 comments on commit 9bfb84b

Please sign in to comment.