-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (136 loc) · 5.05 KB
/
deploy_to_qa.yaml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: 'Deploy to QA'
on:
push:
branches:
- 'develop'
workflow_dispatch: # Allows the workflow to be manually triggered.
concurrency:
group: mimir-qa
cancel-in-progress: true
jobs:
deploy_to_qa:
name: 'Deploy to QA'
runs-on: 'ubuntu-latest'
environment: 'QA_mimir'
steps:
- id: build_app
uses: enonic/release-tools/build-and-publish@master
with:
skipPublishing: true
- id: deploy_app_to_XP
uses: 'enonic/action-app-deploy@main'
with:
url: ${{ secrets.ENONIC_QA_URL }}
username: ${{ secrets.ENONIC_USER }}
password: ${{ secrets.ENONIC_QA_PASS }}
client_cert: ${{ secrets.ENONIC_CERT }}
client_key: ${{ secrets.ENONIC_KEY }}
app_jar: './build/libs/*.jar'
- name: Upload artifacts
id: upload_artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: mimir-qa-${{ github.run_number }}
path: './build/libs/*.jar'
- name: Send success message to Slack
id: slack_success
if: success()
uses: slackapi/slack-github-action@v1
with:
# Using Github block kit (https://api.slack.com/reference/block-kit/blocks) to configure the Slack message, see https://docs.github.com/en/actions/learn-github-actions/contexts
# for more information about context variables
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${{ github.workflow }} in ${{ github.repository }}"
}
},
{
"type": "context",
"elements": [
{
"type": "image",
"image_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"alt_text" : "Github logo"
},
{
"type": "mrkdwn",
"text": "Run by: *${{ github.actor }}* on: *${{ github.ref_name }}*"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "🛠 Build ${{ github.run_number }} is a *${{ job.status }}*, well done!\n<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|Commit or PR>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERTS_QA }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: Send failure message to Slack
id: slack_failure
if: failure()
uses: slackapi/slack-github-action@v1
with:
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${{ github.workflow }} in ${{ github.repository }}"
}
},
{
"type": "context",
"elements": [
{
"type": "image",
"image_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"alt_text" : "Github logo"
},
{
"type": "mrkdwn",
"text": "Run by: *${{ github.actor }}* on: *${{ github.ref_name }}*"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "💣 Build ${{ github.run_number }} is a *${{ job.status }}*, and that's cool!\nIf you want to fix it, start by looking at the <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow output>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_MIMIR_UTV }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
mabl_test:
# Run this job after deploy is finished, and only run if deploy succeeded
needs: deploy_to_qa
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
runs-on: ubuntu-latest
container: node:lts
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Branch name and commit hash
run: |
echo running on branch ${GITHUB_HEAD_REF##*/} or ${GITHUB_REF##*/}
echo running $(echo $GITHUB_SHA | cut -c1-8) and ${GITHUB_SHA}
- name: install mabl
run: npm install -g @mablhq/mabl-cli
- name: mabl end-to-end test - TEST
run: mabl deployments create --api-key ${{ secrets.MABLAPIKEY }} --application-id ${{ secrets.MABLAPPID }} --environment-id ${{ secrets.MABLENVQA }} --labels MIMIR --await-completion