-
Notifications
You must be signed in to change notification settings - Fork 6
51 lines (43 loc) · 1.39 KB
/
deployment.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
name: Continuous Delivery
on:
schedule:
- cron: "0 3 * * 2,4"
jobs:
deploy:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ENVIRONMENT_NAME: ${{ secrets.AWS_ENVIRONMENT_NAME }}
AWS_APPLICATION_NAME: ${{ secrets.AWS_APPLICATION_NAME }}
steps:
- uses: actions/checkout@v2
- name: Install Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.0
- name: Install Dependencies
run: go mod download
- name: Build application
run: go build -o api
- name: Install EB CLI using pip
run: |
python -m pip install --upgrade pip
pip install awsebcli
- name: Initialize EB Environment
run: (echo "2"; echo "n") | eb init -r ${{ env.AWS_DEFAULT_REGION }} ${{ env.AWS_APPLICATION_NAME }}
- name: Set EB Environment
run: eb use ${{ env.AWS_ENVIRONMENT_NAME }} -r ${{ env.AWS_DEFAULT_REGION }}
- name: Deploy to EB
run: |
if eb deploy; then
echo "Deployment succeeded✅"
else
echo "Deployment failed❌"
exit 1
fi