Skip to content

Commit 018bf27

Browse files
author
Nadim Kobeissi
authored
Merge branch 'main' into empieichO-docs-review
2 parents 83cc83c + 72be93d commit 018bf27

File tree

140 files changed

+2373
-4967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+2373
-4967
lines changed

.bash_profile

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/assets/Dockerfile.nginx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#Serve the app with NGINX
2+
FROM nginx:alpine
3+
4+
# Copy the build files from the build folder to /usr/share/nginx/html
5+
COPY site /usr/share/nginx/html
6+
7+
#Replace default nginx.conf with custom configuration
8+
COPY .github/assets/nginx.conf /etc/nginx/conf.d/default.conf
9+
10+
# Expose the desired port (default is 80 for NGINX)
11+
EXPOSE 80
12+
13+
# Start NGINX
14+
CMD ["nginx", "-g", "daemon off;"]

.github/assets/dev-taskdef.json

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"requiresCompatibilities": [
3+
"FARGATE"
4+
],
5+
"inferenceAccelerators": [],
6+
"containerDefinitions": [{
7+
"dnsSearchDomains": null,
8+
"environmentFiles": [],
9+
"entryPoint": null,
10+
"portMappings": [{
11+
"hostPort": 80,
12+
"protocol": "tcp",
13+
"containerPort": 80
14+
}],
15+
"command": null,
16+
"linuxParameters": null,
17+
"cpu": 0,
18+
"environment": null,
19+
"resourceRequirements": null,
20+
"ulimits": null,
21+
"dnsServers": null,
22+
"mountPoints": null,
23+
"workingDirectory": null,
24+
"secrets": null,
25+
"dockerSecurityOptions": null,
26+
"memory": null,
27+
"memoryReservation": null,
28+
"volumesFrom": null,
29+
"stopTimeout": null,
30+
"image": "test",
31+
"startTimeout": null,
32+
"firelensConfiguration": null,
33+
"dependsOn": null,
34+
"disableNetworking": null,
35+
"interactive": null,
36+
"healthCheck": null,
37+
"essential": true,
38+
"links": null,
39+
"hostname": null,
40+
"extraHosts": null,
41+
"pseudoTerminal": null,
42+
"user": null,
43+
"readonlyRootFilesystem": null,
44+
"dockerLabels": null,
45+
"systemControls": null,
46+
"privileged": null,
47+
"name": "docs-dev",
48+
"repositoryCredentials": {
49+
"credentialsParameter": ""
50+
}
51+
}],
52+
"volumes": [],
53+
"networkMode": "awsvpc",
54+
"memory": "1024",
55+
"cpu": "512",
56+
"executionRoleArn": "arn:aws:iam::605436358845:role/docs-dev-TaskRole",
57+
"family": "docs-dev-taskdefinition",
58+
"taskRoleArn": "arn:aws:iam::605436358845:role/docs-dev-TaskRole",
59+
"runtimePlatform": {
60+
"operatingSystemFamily": "LINUX"
61+
},
62+
"tags": [{
63+
"key": "Role",
64+
"value": "frontend-application"
65+
},
66+
{
67+
"key": "ParentService",
68+
"value": "docs-dev"
69+
},
70+
{
71+
"key": "Environment",
72+
"value": "dev"
73+
},
74+
{
75+
"key": "Service",
76+
"value": "docs-dev.polygon.technology"
77+
},
78+
{
79+
"key": "Host",
80+
"value": "AWS"
81+
},
82+
{
83+
"key": "IAC",
84+
"value": "terraform-workspace-aws-dev-applications-eu-west-1-apps-docs-dev-polygon-technology"
85+
},
86+
{
87+
"key": "Team",
88+
"value": "documentation"
89+
},
90+
{
91+
"key": "Name",
92+
"value": "docs-dev-taskdefinition"
93+
}
94+
]
95+
}

.github/assets/nginx.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
server {
2+
listen 0.0.0.0:80;
3+
root /usr/share/nginx/html;
4+
index index.html;
5+
6+
error_page 404 /404.html;
7+
8+
location / {
9+
try_files $uri.html $uri $uri/ /index.html;
10+
}
11+
}

.github/assets/prod-taskdef.json

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"requiresCompatibilities": [
3+
"FARGATE"
4+
],
5+
"inferenceAccelerators": [],
6+
"containerDefinitions": [{
7+
"dnsSearchDomains": null,
8+
"environmentFiles": [],
9+
"entryPoint": null,
10+
"portMappings": [{
11+
"hostPort": 80,
12+
"protocol": "tcp",
13+
"containerPort": 80
14+
}],
15+
"command": null,
16+
"linuxParameters": null,
17+
"cpu": 0,
18+
"environment": null,
19+
"resourceRequirements": null,
20+
"ulimits": null,
21+
"dnsServers": null,
22+
"mountPoints": null,
23+
"workingDirectory": null,
24+
"secrets": null,
25+
"dockerSecurityOptions": null,
26+
"memory": null,
27+
"memoryReservation": null,
28+
"volumesFrom": null,
29+
"stopTimeout": null,
30+
"image": "test",
31+
"startTimeout": null,
32+
"firelensConfiguration": null,
33+
"dependsOn": null,
34+
"disableNetworking": null,
35+
"interactive": null,
36+
"healthCheck": null,
37+
"essential": true,
38+
"links": null,
39+
"hostname": null,
40+
"extraHosts": null,
41+
"pseudoTerminal": null,
42+
"user": null,
43+
"readonlyRootFilesystem": null,
44+
"dockerLabels": null,
45+
"systemControls": null,
46+
"privileged": null,
47+
"name": "docs",
48+
"repositoryCredentials": {
49+
"credentialsParameter": ""
50+
}
51+
}],
52+
"volumes": [],
53+
"networkMode": "awsvpc",
54+
"memory": "1024",
55+
"cpu": "512",
56+
"executionRoleArn": "arn:aws:iam::042947190491:role/docs-TaskRole",
57+
"family": "docs-taskdefinition",
58+
"taskRoleArn": "arn:aws:iam::042947190491:role/docs-TaskRole",
59+
"runtimePlatform": {
60+
"operatingSystemFamily": "LINUX"
61+
},
62+
"tags": [{
63+
"key": "Role",
64+
"value": "frontend-application"
65+
},
66+
{
67+
"key": "ParentService",
68+
"value": "docs"
69+
},
70+
{
71+
"key": "Environment",
72+
"value": "prod"
73+
},
74+
{
75+
"key": "Service",
76+
"value": "docs.polygon.technology"
77+
},
78+
{
79+
"key": "Host",
80+
"value": "AWS"
81+
},
82+
{
83+
"key": "IAC",
84+
"value": "terraform-workspace-aws-prod-applications-eu-west-1-apps-docs-polygon-technology"
85+
},
86+
{
87+
"key": "Team",
88+
"value": "documentation"
89+
},
90+
{
91+
"key": "Name",
92+
"value": "docs-taskdefinition"
93+
}
94+
]
95+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"requiresCompatibilities": [
3+
"FARGATE"
4+
],
5+
"inferenceAccelerators": [],
6+
"containerDefinitions": [{
7+
"dnsSearchDomains": null,
8+
"environmentFiles": [],
9+
"entryPoint": null,
10+
"portMappings": [{
11+
"hostPort": 80,
12+
"protocol": "tcp",
13+
"containerPort": 80
14+
}],
15+
"command": null,
16+
"linuxParameters": null,
17+
"cpu": 0,
18+
"environment": null,
19+
"resourceRequirements": null,
20+
"ulimits": null,
21+
"dnsServers": null,
22+
"mountPoints": null,
23+
"workingDirectory": null,
24+
"secrets": null,
25+
"dockerSecurityOptions": null,
26+
"memory": null,
27+
"memoryReservation": null,
28+
"volumesFrom": null,
29+
"stopTimeout": null,
30+
"image": "test",
31+
"startTimeout": null,
32+
"firelensConfiguration": null,
33+
"dependsOn": null,
34+
"disableNetworking": null,
35+
"interactive": null,
36+
"healthCheck": null,
37+
"essential": true,
38+
"links": null,
39+
"hostname": null,
40+
"extraHosts": null,
41+
"pseudoTerminal": null,
42+
"user": null,
43+
"readonlyRootFilesystem": null,
44+
"dockerLabels": null,
45+
"systemControls": null,
46+
"privileged": null,
47+
"name": "docs-staging",
48+
"repositoryCredentials": {
49+
"credentialsParameter": ""
50+
}
51+
}],
52+
"volumes": [],
53+
"networkMode": "awsvpc",
54+
"memory": "1024",
55+
"cpu": "512",
56+
"executionRoleArn": "arn:aws:iam::070528468658:role/docs-staging-TaskRole",
57+
"family": "docs-staging-taskdefinition",
58+
"taskRoleArn": "arn:aws:iam::070528468658:role/docs-staging-TaskRole",
59+
"runtimePlatform": {
60+
"operatingSystemFamily": "LINUX"
61+
},
62+
"tags": [{
63+
"key": "Role",
64+
"value": "frontend-application"
65+
},
66+
{
67+
"key": "ParentService",
68+
"value": "docs-staging"
69+
},
70+
{
71+
"key": "Environment",
72+
"value": "staging"
73+
},
74+
{
75+
"key": "Service",
76+
"value": "docs-staging.polygon.technology"
77+
},
78+
{
79+
"key": "Host",
80+
"value": "AWS"
81+
},
82+
{
83+
"key": "IAC",
84+
"value": "terraform-workspace-aws-test-applications-eu-west-1-apps-docs-staging-polygon-technology"
85+
},
86+
{
87+
"key": "Team",
88+
"value": "documentation"
89+
},
90+
{
91+
"key": "Name",
92+
"value": "docs-staging-taskdefinition"
93+
}
94+
]
95+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Docs Dev Deployment
2+
on:
3+
push:
4+
branches: ['dev']
5+
workflow_dispatch:
6+
7+
jobs:
8+
deploy_staging:
9+
name: Dev Deployment
10+
permissions:
11+
id-token: write
12+
contents: write
13+
environment: dev
14+
runs-on: ubuntu-latest
15+
env:
16+
AWS_REGION: eu-west-1
17+
ECR_REPOSITORY: docs-dev-ecr
18+
ECS_SERVICE: docs-dev-ecs-service
19+
ECS_CLUSTER: frontend-dev-ecs-cluster
20+
ECS_TASK_DEFINITION: .github/assets/dev-taskdef.json
21+
CONTAINER_NAME: docs-dev
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
with:
26+
submodules: true
27+
28+
- name: Configure AWS credentials
29+
uses: aws-actions/configure-aws-credentials@v1-node16
30+
with:
31+
aws-region: ${{ env.AWS_REGION }}
32+
role-to-assume: arn:aws:iam::605436358845:role/docs-dev-GithubActionsRole
33+
role-session-name: GithubActionsSession
34+
35+
- name: Login to Amazon ECR
36+
id: login-ecr
37+
uses: aws-actions/amazon-ecr-login@v1
38+
39+
- name: Use Python
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: '3.11'
43+
44+
- name: pip Install
45+
run: pip install -r requirements.txt --no-cache-dir
46+
47+
- name: Build mkdocs
48+
run: mkdocs build
49+
50+
- name: Build, tag, and push image to Amazon ECR
51+
id: build-image
52+
env:
53+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
54+
IMAGE_TAG: ${{ github.sha }}
55+
run: |
56+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f .github/assets/Dockerfile.nginx .
57+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
58+
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
59+
60+
- name: Fill in the new image ID in the Amazon ECS task definition
61+
id: task-def
62+
uses: aws-actions/amazon-ecs-render-task-definition@v1
63+
with:
64+
task-definition: ${{ env.ECS_TASK_DEFINITION }}
65+
container-name: ${{ env.CONTAINER_NAME }}
66+
image: ${{ steps.build-image.outputs.image }}
67+
68+
- name: Deploy Amazon ECS task definition
69+
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
70+
with:
71+
task-definition: ${{ steps.task-def.outputs.task-definition }}
72+
service: ${{ env.ECS_SERVICE }}
73+
cluster: ${{ env.ECS_CLUSTER }}
74+
wait-for-service-stability: true

0 commit comments

Comments
 (0)