parent
7b63fbeaf6
commit
9a1f56b2f0
@ -0,0 +1,62 @@
|
||||
name: CI
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push to master or development
|
||||
# with a tag like v1.0.0 or v1.0.0-dev
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
- v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z]+
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-1
|
||||
|
||||
- name: Login to Amazon ECR
|
||||
id: login-ecr
|
||||
uses: aws-actions/amazon-ecr-login@v1
|
||||
|
||||
- name: Get Version
|
||||
id: get_version
|
||||
uses: battila7/get-version-action@v2.0.0
|
||||
|
||||
- name: Build, tag, and push image to Amazon ECR
|
||||
id: build-image
|
||||
env:
|
||||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||
ECR_REPOSITORY: prepbot
|
||||
IMAGE_TAG: ${{ steps.get_version.outputs.version-without-v }}
|
||||
run: |
|
||||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
||||
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
|
||||
|
||||
- name: Fill in the new image ID in the Amazon ECS task definition
|
||||
id: task-def
|
||||
uses: aws-actions/amazon-ecs-render-task-definition@v1
|
||||
with:
|
||||
task-definition: task-definition.json
|
||||
container-name: "prepbot"
|
||||
image: ${{ steps.build-image.outputs.image }}
|
||||
|
||||
- name: Deploy Amazon ECS task definition
|
||||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
|
||||
with:
|
||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
||||
service: "prepbot"
|
||||
cluster: "discord-bots"
|
||||
wait-for-service-stability: true
|
||||
@ -0,0 +1,122 @@
|
||||
{
|
||||
"ipcMode": null,
|
||||
"executionRoleArn": "arn:aws:iam::005692590034:role/goff_ecs_rds+cw+ecr",
|
||||
"containerDefinitions": [
|
||||
{
|
||||
"dnsSearchDomains": null,
|
||||
"environmentFiles": null,
|
||||
"logConfiguration": {
|
||||
"logDriver": "awslogs",
|
||||
"secretOptions": null,
|
||||
"options": {
|
||||
"awslogs-group": "/ecs/prepbot",
|
||||
"awslogs-region": "us-east-1",
|
||||
"awslogs-stream-prefix": "ecs"
|
||||
}
|
||||
},
|
||||
"entryPoint": null,
|
||||
"portMappings": [],
|
||||
"command": null,
|
||||
"linuxParameters": null,
|
||||
"cpu": 0,
|
||||
"environment": [],
|
||||
"resourceRequirements": null,
|
||||
"ulimits": null,
|
||||
"dnsServers": null,
|
||||
"mountPoints": [],
|
||||
"workingDirectory": null,
|
||||
"secrets": [
|
||||
{
|
||||
"valueFrom": "prepbot_discord_token",
|
||||
"name": "DISCORD_TOKEN"
|
||||
}
|
||||
],
|
||||
"dockerSecurityOptions": null,
|
||||
"memory": 512,
|
||||
"memoryReservation": null,
|
||||
"volumesFrom": [],
|
||||
"stopTimeout": null,
|
||||
"image": "005692590034.dkr.ecr.us-east-1.amazonaws.com/prepbot:latest",
|
||||
"startTimeout": null,
|
||||
"firelensConfiguration": null,
|
||||
"dependsOn": null,
|
||||
"disableNetworking": null,
|
||||
"interactive": null,
|
||||
"healthCheck": null,
|
||||
"essential": true,
|
||||
"links": null,
|
||||
"hostname": null,
|
||||
"extraHosts": null,
|
||||
"pseudoTerminal": null,
|
||||
"user": null,
|
||||
"readonlyRootFilesystem": null,
|
||||
"dockerLabels": null,
|
||||
"systemControls": null,
|
||||
"privileged": null,
|
||||
"name": "prepbot"
|
||||
}
|
||||
],
|
||||
"placementConstraints": [],
|
||||
"memory": "512",
|
||||
"taskRoleArn": "arn:aws:iam::005692590034:role/goff_ecs_rds+cw+ecr",
|
||||
"compatibilities": [
|
||||
"EC2"
|
||||
],
|
||||
"taskDefinitionArn": "arn:aws:ecs:us-east-1:005692590034:task-definition/prepbot:2",
|
||||
"family": "prepbot",
|
||||
"requiresAttributes": [
|
||||
{
|
||||
"targetId": null,
|
||||
"targetType": null,
|
||||
"value": null,
|
||||
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
|
||||
},
|
||||
{
|
||||
"targetId": null,
|
||||
"targetType": null,
|
||||
"value": null,
|
||||
"name": "ecs.capability.execution-role-awslogs"
|
||||
},
|
||||
{
|
||||
"targetId": null,
|
||||
"targetType": null,
|
||||
"value": null,
|
||||
"name": "com.amazonaws.ecs.capability.ecr-auth"
|
||||
},
|
||||
{
|
||||
"targetId": null,
|
||||
"targetType": null,
|
||||
"value": null,
|
||||
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
|
||||
},
|
||||
{
|
||||
"targetId": null,
|
||||
"targetType": null,
|
||||
"value": null,
|
||||
"name": "com.amazonaws.ecs.capability.task-iam-role"
|
||||
},
|
||||
{
|
||||
"targetId": null,
|
||||
"targetType": null,
|
||||
"value": null,
|
||||
"name": "ecs.capability.execution-role-ecr-pull"
|
||||
},
|
||||
{
|
||||
"targetId": null,
|
||||
"targetType": null,
|
||||
"value": null,
|
||||
"name": "ecs.capability.secrets.ssm.environment-variables"
|
||||
}
|
||||
],
|
||||
"pidMode": null,
|
||||
"requiresCompatibilities": [
|
||||
"EC2"
|
||||
],
|
||||
"networkMode": null,
|
||||
"cpu": "1024",
|
||||
"revision": 2,
|
||||
"status": "ACTIVE",
|
||||
"inferenceAccelerators": null,
|
||||
"proxyConfiguration": null,
|
||||
"volumes": []
|
||||
}
|
||||
Loading…
Reference in new issue