This repository is currently being migrated. It's locked while the migration is in progress.
forked from shughes-uk/resume
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (61 loc) · 2.41 KB
/
deploy.yml
File metadata and controls
68 lines (61 loc) · 2.41 KB
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
name: Deploy
on:
push:
branches:
- main
permissions:
id-token: write # This is required for requesting tghe JWT
contents: read # This is required for actions/checkout
jobs:
deploy-cube:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::471881062455:role/system/github_actions_role
role-session-name: GitHub_to_AWS_sync_svc_cube
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2.0.1
with:
mask-password: "false"
- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: sync-svc-cube
IMAGE_TAG: "${{ github.sha }}"
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
- name: Update cube-api Task Definition with latest image
id: cube-api-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1.6.2
with:
task-definition-family: cube_api
container-name: cube-api
image: ${{ steps.login-ecr.outputs.registry }}/sync-svc-cube:${{ github.sha }}
- name: Update cube-refresh-worker Task Definition with latest image
id: cube-refresh-worker-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1.6.2
with:
task-definition-family: cube_refresh_worker
container-name: cube-refresh-worker
image: ${{ steps.login-ecr.outputs.registry }}/sync-svc-cube:${{ github.sha }}
- name: Deploy cube-api task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v2.3.0
with:
task-definition: ${{ steps.cube-api-task-def.outputs.task-definition }}
service: cube_api
cluster: production
wait-for-service-stability: true
- name: Deploy cube-refresh-worker task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v2.3.0
with:
task-definition: ${{ steps.cube-refresh-worker-task-def.outputs.task-definition }}
service: cube_refresh_worker
cluster: production
wait-for-service-stability: true