mirror of
https://github.com/tlsnotary/tlsn-plugin-demo.git
synced 2026-01-08 04:54:07 -05:00
Create workflow + aux scripts for build/deploy
This commit is contained in:
13
.github/scripts/build.sh
vendored
Executable file
13
.github/scripts/build.sh
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# Download poaps
|
||||
aws s3 cp s3://tlsn-plugin-demo/poaps.txt server/util/
|
||||
|
||||
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 490752553772.dkr.ecr.eu-central-1.amazonaws.com
|
||||
|
||||
docker build -t tlsn-plugin-demo .
|
||||
docker tag tlsn-plugin-demo:latest 490752553772.dkr.ecr.eu-central-1.amazonaws.com/tlsn-plugin-demo:latest
|
||||
docker push 490752553772.dkr.ecr.eu-central-1.amazonaws.com/tlsn-plugin-demo:latest
|
||||
|
||||
exit 0
|
||||
13
.github/scripts/deploy.sh
vendored
Executable file
13
.github/scripts/deploy.sh
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
tasks="tlsn-plugin-demo"
|
||||
for task in $tasks; do
|
||||
revision=$(aws ecs describe-task-definition --task-definition $task --query "taskDefinition.revision")
|
||||
aws ecs update-service --cluster tlsn-plugin-demo --service $task --force-new-deployment --task-definition $task:$revision
|
||||
done
|
||||
|
||||
for loop in {1..3}; do
|
||||
[ "$loop" -eq 3 ] && exit 1
|
||||
aws ecs wait services-stable --cluster tlsn-plugin-demo --services $tasks && break || continue
|
||||
done
|
||||
36
.github/workflows/deploy.yml
vendored
Normal file
36
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Deploy
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
role-to-assume: arn:aws:iam::490752553772:role/tlsn-plugin-demo-ecs-deploy-slc
|
||||
role-duration-seconds: 1800
|
||||
aws-region: eu-central-1
|
||||
|
||||
- name: Build and Push images to ECR
|
||||
run: |
|
||||
.github/scripts/build.sh
|
||||
|
||||
- name: Trigger Deployment
|
||||
run: |
|
||||
.github/scripts/deploy.sh
|
||||
Reference in New Issue
Block a user