forked from ringcentral/slate
-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (54 loc) · 2.06 KB
/
replicated-release-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Replicated release build
on:
workflow_dispatch:
inputs:
version:
description: Version
required: true
default: 1.x
push:
tags:
- v*
jobs:
prepare-replicated-release:
env:
RR_USERNAME: ${{ secrets.REPLICATED_REGISTRY_USERNAME }}
RR_PASSWORD: ${{ secrets.REPLICATED_REGISTRY_PASSWORD }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get tag
id: tag
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: Authenticate to Docker
run: docker login registry.replicated.com -u "${RR_USERNAME}" -p "${RR_PASSWORD}"
- name: Build the Docker image
run: docker build -t cucumber-studio-api-documentation .
- name: Tag the Docker image
run: docker tag cucumber-studio-api-documentation registry.replicated.com/hiptest/cucumber-studio-api-documentation:${{github.event.inputs.version || steps.tag.outputs.VERSION}}
- name: Push the Docker image
run: docker push registry.replicated.com/hiptest/cucumber-studio-api-documentation:${{github.event.inputs.version || steps.tag.outputs.VERSION}}
notify-failure:
runs-on: ubuntu-latest
needs: [prepare-replicated-release]
if: ${{ failure() }}
steps:
- name: Slack notification
uses: 8398a7/action-slack@v3
with:
status: custom
custom_payload: |
{
username: 'TEST Replicated Build CucumberStudio API Documentation',
icon_emoji: ':cucumberstudio:'
channel: '#cbo_test_channel',
text: ":red_circle: Replicated release build for API Documentation failed",
attachments: [{
"color": "danger",
"title": 'GitHub action: Replicated release build',
"title_link": 'https://github.com/${{github.repository}}/actions/workflows/replicated-release-build.yml'
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}