-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.8 KB
/
deploy-webapp-production.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
name: PRODUCTION - Deploy WEBAPP
env:
HUSKY: 0
on:
push:
tags:
- "*"
jobs:
build-web:
runs-on: ubuntu-latest
environment:
name: production
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_WEB }}
IMAGE_TAG: ${{ github.sha }}
VITE_STRIPE_PUBLISHABLE_KEY: ${{secrets.VITE_STRIPE_PUBLISHABLE_KEY}}
run: |
docker build -f ./web.Dockerfile --build-arg VERSION=$IMAGE_TAG --build-arg VITE_STRIPE_PUBLISHABLE_KEY=$VITE_STRIPE_PUBLISHABLE_KEY -t $ECR_REGISTRY:$IMAGE_TAG .
docker tag $ECR_REGISTRY:$IMAGE_TAG $ECR_REGISTRY:latest
docker push $ECR_REGISTRY:$IMAGE_TAG
docker push $ECR_REGISTRY:latest
- name: Install Selleo CLI
uses: jaxxstorm/[email protected]
with:
repo: selleo/cli
tag: v0.26.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: ECS Deployment
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
ECS_CLUSTER: ${{ secrets.AWS_ECS_CLUSTER }}
ECS_SERVICE: ${{ secrets.AWS_ECS_SERVICE_WEB }}
DOCKER_IMAGE: ${{ secrets.AWS_ECR_REGISTRY_WEB }}:${{ github.sha }}
run: selleo aws ecs deploy --region $AWS_REGION --cluster $ECS_CLUSTER --service $ECS_SERVICE --docker-image $DOCKER_IMAGE