Soutrik commited on
Commit
45e6ca1
·
1 Parent(s): 1567755

new deployment file added

Browse files
.github/workflows/deploy.yml CHANGED
@@ -4,7 +4,7 @@ on:
4
  push:
5
  branches:
6
  - main
7
- - feat/framework-setup
8
 
9
  jobs:
10
  deploy:
 
4
  push:
5
  branches:
6
  - main
7
+ # - feat/framework-setup
8
 
9
  jobs:
10
  deploy:
.github/workflows/deploy_new.yml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy to ECR and Run Docker Compose with AWS Actions for GitHub and Docker Buildx
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - feat/framework-setup
8
+
9
+ jobs:
10
+ deploy:
11
+ runs-on: self-hosted
12
+
13
+ steps:
14
+ - name: Checkout repository
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Set up Docker Buildx
18
+ uses: docker/setup-buildx-action@v3
19
+
20
+ - name: Configure AWS credentials
21
+ uses: aws-actions/configure-aws-credentials@v4
22
+ with:
23
+ role-to-assume: arn:aws:iam::123456789012:role/my-github-actions-role
24
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
25
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
26
+ aws-region: ${{ secrets.AWS_REGION }}
27
+
28
+ - name: Log in to Amazon ECR
29
+ id: login-ecr
30
+ uses: aws-actions/amazon-ecr-login@v2
31
+
32
+ - name: Build, tag, and push docker image to Amazon ECR
33
+ env:
34
+ POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
35
+ POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
36
+ POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
37
+ REDIS_PORT: ${{ secrets.REDIS_PORT }}
38
+ REDIS_HOST: ${{ secrets.REDIS_HOST }}
39
+ FLOWER_BASIC_AUTH: ${{ secrets.FLOWER_BASIC_AUTH }}
40
+ REDIS_URL: ${{ secrets.REDIS_URL }}
41
+ DATABASE_URL: ${{ secrets.DATABASE_URL }}
42
+ BROKER_URL: ${{ secrets.BROKER_URL }}
43
+ REGISTRY: ${{ steps.login-ecr.outputs.registry }}
44
+ REPOSITORY: soutrik71/test
45
+ IMAGE_TAG: ${{ github.sha }}
46
+ run: |
47
+ docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
48
+ docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
49
+
50
+
51
+ - name: Run Docker Compose
52
+ env:
53
+ POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
54
+ POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
55
+ POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
56
+ REDIS_PORT: ${{ secrets.REDIS_PORT }}
57
+ REDIS_HOST: ${{ secrets.REDIS_HOST }}
58
+ FLOWER_BASIC_AUTH: ${{ secrets.FLOWER_BASIC_AUTH }}
59
+ REDIS_URL: ${{ secrets.REDIS_URL }}
60
+ DATABASE_URL: ${{ secrets.DATABASE_URL }}
61
+ BROKER_URL: ${{ secrets.BROKER_URL }}
62
+ run: |
63
+ docker-compose up -d --build app