This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (66 loc) · 2.09 KB
/
deploy_ecs-config-server_TESTNET.yaml
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
69
70
71
72
73
74
75
76
77
78
79
name: Deploy ECS Config-Server TESTNET
on:
release:
type:
- published
env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
ENVIRONMENT: TESTNET
AWS_STAGE: '${{ secrets.AWS_ARN }}'
REGISTRY: 'ghcr.io'
TAG: 'stable'
jobs:
push:
name: push
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: checkout the source code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: login to ghcr
id: ghcr
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: build / tag / push docker image into ghcr
id: build-and-push
uses: docker/build-push-action@v3
with:
context: .
file: server.dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}/config-server:${{ env.TAG }}
deploy:
needs: push
name: deploy
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: checkout the source code
uses: actions/checkout@v3
- name: checkout ecs repo
uses: actions/checkout@v3
with:
repository: sygmaprotocol/devops
token: ${{ secrets.GHCR_TOKEN }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ env.AWS_STAGE }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
aws-region: ${{ env.AWS_REGION }}
role-session-name: GithubActions
- name: Deploy to Amazon ECS
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: 'sygma-ui/ecs/task_definition-config-server-${{ env.ENVIRONMENT }}.json'
service: 'config-server-service-${{ env.ENVIRONMENT }}'
cluster: 'config-server-${{ env.ENVIRONMENT }}'
wait-for-service-stability: true