Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
zain1824 authored Jul 20, 2024
1 parent 33e4aa4 commit bbbcd97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 30 deletions.
31 changes: 1 addition & 30 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
name: CD

env:
AWS_REGION: ${{ secrets.AWS_REGION }} # set this to your preferred AWS region, e.g. us-west-1
ECR_REPOSITORY: web # set this to your Amazon ECR repository name
ECS_SERVICE: web-service # set this to your Amazon ECS service name
ECS_CLUSTER: web-cluster # set this to your Amazon ECS cluster name
ECS_TASK_DEFINITION: web-td # set this to the path to your Amazon ECS task definition # file, e.g. .aws/task-definition.json
CONTAINER_NAME: web-container # set this to the name of the container in the

on:
workflow_run:
workflows: ["CI"]
Expand All @@ -32,28 +24,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a

- 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: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Render Amazon ECS task definition
working-directory: task-definition
run:
terraform init && terraform apply -auto-approve

terraform init && terraform apply -auto-approve
7 changes: 7 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,12 @@
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
<a href="http://thecatapi.com"><img src="http://thecatapi.com/api/images/get?format=src&type=gif"></a>
</body>
</html>

0 comments on commit bbbcd97

Please sign in to comment.