-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (39 loc) · 1.47 KB
/
upload_preprod.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
name: Upload Release to ECR preprod
#concurrency: upload_to_ecr
on:
release:
branches: [ "*" ]
types:
- created
jobs:
upload:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.3]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
name: Upload new Release to ECR
steps:
- name: Checkout
uses: actions/checkout@v3
with:
node-version: ${{ matrix.node-version }}
#adding node versions
- name: Configure AWS credentials in preprod
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_PREPROD }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PREPROD }}
aws-region: eu-west-2
- name: Login to ECR in preprod
id: login-ecr
uses: aws-actions/[email protected]
- name: Build & Push Image to ECR in preprod
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: beis
IMAGE_TAG: latest
run: |
docker build --no-cache -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG --build-arg BUILD_NUMBER=${{ github.run_number }} --build-arg GIT_REF=$(git log -n 1 | awk '{print $2; exit}') .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
aws ecs update-service --force-new-deployment --service ecs_webserver --cluster ecs_webserver