File tree Expand file tree Collapse file tree 4 files changed +87
-0
lines changed
Expand file tree Collapse file tree 4 files changed +87
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -ex
3+
4+ aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 490752553772.dkr.ecr.eu-central-1.amazonaws.com
5+
6+ docker build -t tlsnotary-explorer -f apps/Dockerfile .
7+ docker tag tlsnotary-explorer:latest 490752553772.dkr.ecr.eu-central-1.amazonaws.com/tlsnotary-explorer:latest
8+ docker push 490752553772.dkr.ecr.eu-central-1.amazonaws.com/tlsnotary-explorer:latest
9+
10+ exit 0
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -ex
3+
4+ ecs_cluster=" tlsnotary-explorer"
5+ services=" tlsnotary-explorer"
6+
7+ for service in $services ; do
8+ tlsnotary_explorer_revision=$( aws ecs describe-task-definition --task-definition $service --query " taskDefinition.revision" )
9+ aws ecs update-service --cluster $ecs_cluster --service $service --force-new-deployment --task-definition $service :$tlsnotary_explorer_revision
10+ done
11+
12+ aws ecs wait services-stable --cluster $ecs_cluster --services $services && break || continue
13+
14+ exit 0
Original file line number Diff line number Diff line change 1+ name : cd-deploy
2+ on :
3+ push :
4+ branches :
5+ - main
6+
7+ concurrency :
8+ group : ${{ github.workflow }}-${{ github.ref }}
9+ cancel-in-progress : true
10+
11+ jobs :
12+ deploy :
13+ runs-on : ubuntu-latest
14+ permissions :
15+ id-token : write
16+ contents : read
17+
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v2
21+ with :
22+ persist-credentials : false
23+
24+ - name : Configure AWS Credentials
25+ uses : aws-actions/configure-aws-credentials@v2
26+ with :
27+ role-to-assume : arn:aws:iam::490752553772:role/tlsnotary-explorer-ecs-deploy-slc
28+ role-duration-seconds : 2700
29+ aws-region : eu-central-1
30+
31+ - name : Build and Push images to ECR
32+ run : |
33+ .github/scripts/build.sh
34+
35+ - name : Trigger Deployment
36+ run : |
37+ .github/scripts/deploy.sh
Original file line number Diff line number Diff line change 1+ # Build app
2+ FROM node:latest as builder
3+
4+ ENV PATH="${PATH}:/root/.cargo/bin"
5+ WORKDIR /builder
6+
7+ COPY . .
8+
9+ RUN curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y
10+ RUN npm i
11+ RUN npm i --prefix rs/verifier/
12+ RUN npm run build
13+
14+ # Create image for the app by copying build artifacts from builder
15+ FROM node:latest as runner
16+
17+ RUN apt-get update; apt-get install netcat-openbsd -y
18+ USER node
19+
20+ ARG PORT=3000
21+
22+ WORKDIR /home/node/explorer
23+ COPY --from=builder /builder/build ./build
24+
25+ EXPOSE ${PORT}
26+ CMD ["node" , "build/server/index.bundle.js" ]
You can’t perform that action at this time.
0 commit comments