chore: remove aws fargate deployment
This commit is contained in:
54
.github/workflows/ci-cd.yml
vendored
54
.github/workflows/ci-cd.yml
vendored
@@ -1,54 +0,0 @@
|
|||||||
name: Deploy to Production
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Configure AWS credentials
|
|
||||||
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
|
|
||||||
with:
|
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws-region: ${{ secrets.AWS_REGION }}
|
|
||||||
|
|
||||||
- name: Log into Amazon ECR
|
|
||||||
id: login-ecr
|
|
||||||
uses: aws-actions/amazon-ecr-login@v2
|
|
||||||
|
|
||||||
- name: Build, tag, and push image to Amazon ECR
|
|
||||||
id: build-image
|
|
||||||
env:
|
|
||||||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
|
||||||
IMAGE_TAG: ${{ github.sha }}
|
|
||||||
run: |
|
|
||||||
docker build -t $ECR_REGISTRY/stan/personal-website:$IMAGE_TAG --build-arg DB_URL='${{ secrets.DB_URL }}' --build-arg AUTH_TOKEN='${{ secrets.AUTH_TOKEN }}' packages/web
|
|
||||||
docker push $ECR_REGISTRY/stan/personal-website:$IMAGE_TAG
|
|
||||||
echo "image=$ECR_REGISTRY/stan/personal-website:$IMAGE_TAG" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Render ECS Task Definition
|
|
||||||
id: task-def
|
|
||||||
uses: aws-actions/amazon-ecs-render-task-definition@c804dfbdd57f713b6c079302a4c01db7017a36fc
|
|
||||||
with:
|
|
||||||
task-definition: .github/workflows/taskdef.json
|
|
||||||
container-name: web
|
|
||||||
image: ${{ steps.build-image.outputs.image }}
|
|
||||||
|
|
||||||
- name: Deploy to Amazon ECS
|
|
||||||
uses: aws-actions/amazon-ecs-deploy-task-definition@df9643053eda01f169e64a0e60233aacca83799a
|
|
||||||
with:
|
|
||||||
task-definition: ${{ steps.task-def.outputs.task-definition }}
|
|
||||||
service: main-service
|
|
||||||
cluster: PersonalWebsiteCluster
|
|
||||||
wait-for-service-stability: true
|
|
||||||
54
.github/workflows/taskdef.json
vendored
54
.github/workflows/taskdef.json
vendored
@@ -1,54 +0,0 @@
|
|||||||
{
|
|
||||||
"family": "personal-website",
|
|
||||||
"containerDefinitions": [
|
|
||||||
{
|
|
||||||
"name": "web",
|
|
||||||
"image": "949678216675.dkr.ecr.eu-west-1.amazonaws.com/stan/personal-website",
|
|
||||||
"cpu": 0,
|
|
||||||
"portMappings": [
|
|
||||||
{
|
|
||||||
"containerPort": 3000,
|
|
||||||
"hostPort": 3000,
|
|
||||||
"protocol": "tcp"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"essential": true,
|
|
||||||
"environment": [
|
|
||||||
{
|
|
||||||
"name": "ORIGIN",
|
|
||||||
"value": "https://stanrunge.dev"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"mountPoints": [],
|
|
||||||
"volumesFrom": [],
|
|
||||||
"secrets": [
|
|
||||||
{
|
|
||||||
"name": "DB_URL",
|
|
||||||
"valueFrom": "arn:aws:secretsmanager:eu-west-1:949678216675:secret:DB_URL-NmGgN8:DB_URL::"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "AUTH_TOKEN",
|
|
||||||
"valueFrom": "arn:aws:secretsmanager:eu-west-1:949678216675:secret:personal-website/auth-token-odxL2n:PERSONAL_TOKEN::"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"logConfiguration": {
|
|
||||||
"logDriver": "awslogs",
|
|
||||||
"options": {
|
|
||||||
"awslogs-group": "/ecs/personal-website",
|
|
||||||
"awslogs-region": "eu-west-1",
|
|
||||||
"awslogs-stream-prefix": "ecs"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systemControls": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"executionRoleArn": "arn:aws:iam::949678216675:role/ecsTaskExecutionRole",
|
|
||||||
"networkMode": "awsvpc",
|
|
||||||
"volumes": [],
|
|
||||||
"placementConstraints": [],
|
|
||||||
"requiresCompatibilities": [
|
|
||||||
"FARGATE"
|
|
||||||
],
|
|
||||||
"cpu": "256",
|
|
||||||
"memory": "512"
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user