-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (75 loc) · 2.36 KB
/
release.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
name: Release
on:
push:
tags: [v*]
env:
PROJECT: casimir
STAGE: prod
AWS_REGION: us-east-2
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout the repo with submodules
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Setup Node.js LTS
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Get the tag name
run: |
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
# - name: Install action dependencies
# run: |
# curl -sSf https://atlasgo.sh | sh
- name: Install and build all package dependencies
run: npm ci
- name: Deploy CDK infrastructure
run: npm run deploy:cdk
# - name: Migrate users database
# run: npm run migrations:users
- name: Checkout develop
uses: actions/checkout@v3
with:
ref: develop
token: ${{ github.token }}
- name: Reset release branch
run: |
git fetch origin master:master
git reset --hard master
- name: Create a pull request
uses: peter-evans/create-pull-request@v3
with:
base: develop
branch: master
reviewers: robosupport
token: ${{ github.token }}
title: "Sync master with develop"
- name: Slack the team
if: ${{ success() || failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<https://casimir.co | *:ocean: Casimir (Prod)*> deployment finished with <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | _${{ job.status }}_>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK