From 3fa02db9d3b0761165a0e03d56563f37165dbe00 Mon Sep 17 00:00:00 2001 From: Nikita Andriyanov Date: Thu, 17 Apr 2025 14:36:06 +0300 Subject: [PATCH] fixes --- .gitea/actions/k8s/action.yaml | 1 + .gitea/actions/notify/action.yaml | 26 ++++++++++++++++++++++++++ .github/workflows/deployk8s.yaml | 8 ++------ 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 .gitea/actions/notify/action.yaml diff --git a/.gitea/actions/k8s/action.yaml b/.gitea/actions/k8s/action.yaml index 3fbe650..1ddcc16 100644 --- a/.gitea/actions/k8s/action.yaml +++ b/.gitea/actions/k8s/action.yaml @@ -17,6 +17,7 @@ inputs: required: true runs: + using: 'composite' steps: - run: "echo a: Set up QEMU2" diff --git a/.gitea/actions/notify/action.yaml b/.gitea/actions/notify/action.yaml new file mode 100644 index 0000000..f55bdc9 --- /dev/null +++ b/.gitea/actions/notify/action.yaml @@ -0,0 +1,26 @@ +name: 'notify' +description: 'notify' + +inputs: + result: + required: false + default: "failure" + type: string + name: + required: false + type: string + default: build + +env: + icons: '{"success" : ":white_check_mark:", "failure": ":x:", "canceled": ":facepalm:", "started": ":warning:"}' + +runs: + using: 'composite' + steps: + - uses: mattermost/action-mattermost-notify@master + with: + MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }} + PAYLOAD: | + { + "text": "${{ github.repository }} [${{inputs.name}}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}) was ${{ inputs.result }} by ${{ github.event.sender.login}} ${{ fromJson(env.icons)[inputs.result]}}" + } diff --git a/.github/workflows/deployk8s.yaml b/.github/workflows/deployk8s.yaml index bfc3b20..51cf33e 100644 --- a/.github/workflows/deployk8s.yaml +++ b/.github/workflows/deployk8s.yaml @@ -23,12 +23,6 @@ on: required: true jobs: - prenotify: - uses: HUB/workflows/.github/workflows/notify.yaml@main - with: - result: 'started' - name: k8s deploy ${{ inputs.environment }} tag ${{ inputs.tag }} - secrets: inherit deploy: runs-on: ubuntu-latest env: @@ -36,6 +30,8 @@ jobs: CR_REPO: ${{ github.event.repository.name }} TAG: ${{ inputs.tag }} steps: + - name: notify + uses: ./gitea/actions/notify - name: Argo Login uses: clowdhaus/argo-cd-action/@main with: