diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 0000000..211a502 --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -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 }} diff --git a/.github/workflows/notification.yml b/.github/workflows/notification.yml index ed7bf84..515b490 100644 --- a/.github/workflows/notification.yml +++ b/.github/workflows/notification.yml @@ -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: