-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (96 loc) · 2.81 KB
/
deploy.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
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
name: Deploy Configurations To DB
on:
workflow_call:
inputs:
deploy_url:
required: true
type: string
notify:
type: boolean
version:
type: string
secrets:
API_USERNAME:
required: true
API_PASSWORD:
required: true
SLACK_BOT_TOKEN:
required: true
SLACK_RELEASE_CHANNEL_ID:
required: true
jobs:
deploy:
name: Deployment To DB
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
- name: Setup Node
uses: actions/setup-node@v4.0.2
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Dependencies
env:
HUSKY: 0
run: |
npm run setup
- name: Display Python Version
run: |
which python
python -c "import sys; print(sys.version)"
- name: Execute Unit Tests
env:
HUSKY: 0
run: |
npm run test:ci
- name: List Working Directory Files
run: |
echo current directory
pwd
ls -a
- name: Display Current Package Version
run: echo $(jq -r .version package.json)
- name: Deploy To DB
env:
API_USER: ${{ secrets.API_USERNAME }}
API_PASSWORD: ${{ secrets.API_PASSWORD }}
run: |
python scripts/deployToDB.py ${{ inputs.deploy_url }}
- name: Notify Slack Channel
id: slack
uses: slackapi/slack-github-action@v1.25.0
continue-on-error: true
if: inputs.notify == true
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PROJECT_NAME: 'Rudder Integrations Config'
RELEASES_URL: 'https://github.com/rudderlabs/rudder-integrations-config/releases/tag/'
with:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": "*<${{env.RELEASES_URL}}v${{ inputs.version }}|v${{ inputs.version }}>*\nCC: <!subteam^S02AEQL26CT>",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":tada: ${{ env.PROJECT_NAME }} - Production Deployment Complete :tada:"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{env.RELEASES_URL}}v${{ inputs.version }}|v${{ inputs.version }}>*\nCC: <!subteam^S02AEQL26CT>"
}
}
]
}