Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abel/deploy #48

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a7ffc82
Fix callback URI
abelr20 Aug 2, 2024
1ab8bb4
Add GitHub Actions workflow for ECS deployment
abelr20 Aug 14, 2024
6b7f8ea
Fix Build phase Github Actions workflow
abelr20 Aug 14, 2024
c865c4c
Build image from ECR
abelr20 Aug 14, 2024
efd2cc1
Update Docker to use public base
abelr20 Aug 14, 2024
c1104b5
Build using docker buildx
abelr20 Aug 14, 2024
2e64993
Add Docker Buildx setup
abelr20 Aug 14, 2024
0a279a1
Fix filenames and paths for CI/CD deploy
abelr20 Aug 14, 2024
aba3fe9
Fix Nav error
abelr20 Aug 14, 2024
06d53a0
Update Dockerfile npm install
abelr20 Aug 14, 2024
7ba0a5e
Fix tsc error
abelr20 Aug 14, 2024
cb54449
Test Github actions workflow
abelr20 Aug 14, 2024
7a810e3
fix: update webpack icon path to show logo in readme
abelr20 Aug 14, 2024
594be67
fix: ensure npm is updated
abelr20 Aug 14, 2024
66c0820
fix: update workflow with npm update
abelr20 Aug 14, 2024
cbe4c47
feat: add concurrency to prevent multi-deploy
abelr20 Aug 14, 2024
4910d2d
fix: update workflow actions versions
abelr20 Aug 14, 2024
d219d51
fix: change IMAGE_TAG to latest
abelr20 Aug 14, 2024
74fd539
fix: fix ECR tagging
abelr20 Aug 14, 2024
d566838
fix: update aws cred to v4
abelr20 Aug 14, 2024
a576fbf
Test if ECR is fixed
abelr20 Aug 14, 2024
0bf0d4f
fix: Test Fargate_Spot config
abelr20 Aug 22, 2024
ce4b231
fix: switch from arm to x86 for Fargate Spot compatibility
abelr20 Aug 22, 2024
9450de4
fix: change cpuARch to X86_64
abelr20 Aug 22, 2024
effcc29
fix: task definition will now be updated in workflow
abelr20 Aug 22, 2024
91a2a1b
fix: ensure new task def revision is used when redeploying
abelr20 Aug 22, 2024
6c36c13
fix: disable rolling update strategy
abelr20 Aug 22, 2024
64bc5c7
fix: ensure new revision to task def only if changes detected
abelr20 Aug 22, 2024
eb4aef9
fix: update workflow describetask error
abelr20 Aug 22, 2024
60f494b
fix: allow rolling updates
abelr20 Aug 22, 2024
585b859
fix: test if fix for task def worked
abelr20 Aug 22, 2024
b2b9796
fix: test if task def works
abelr20 Aug 22, 2024
7870c1f
fix: update workflow name
abelr20 Aug 22, 2024
22d8afe
feat: add favicon logo
abelr20 Aug 22, 2024
bb5707c
fix: test deploy
abelr20 Aug 22, 2024
c846af7
fix: add link to favicon
abelr20 Aug 22, 2024
e1e68d5
fix: workflow update
abelr20 Aug 22, 2024
b1efadf
fix: update path to favicon
abelr20 Aug 22, 2024
338960b
fix: dont create new def revision
abelr20 Aug 22, 2024
e430fd0
fix: favicon path update
abelr20 Aug 22, 2024
19636b7
fix: fix fav icon path
abelr20 Aug 22, 2024
55a1868
fix: no force-redeploy
abelr20 Aug 22, 2024
3af178a
fix: revert to working workflow, fix icon path
abelr20 Aug 22, 2024
706fd14
fix: arm64 to x86
abelr20 Aug 22, 2024
e9aef79
fix: arm64 to x86 description
abelr20 Aug 22, 2024
6f25d73
fix: load favicon
abelr20 Aug 22, 2024
cb79400
fix: test workflow
abelr20 Aug 22, 2024
9a9777f
fix: test if workflow works
abelr20 Aug 22, 2024
cbfc554
fix: fix favicon path error
abelr20 Aug 22, 2024
10a1941
fix: test with no force-redeploy
abelr20 Aug 22, 2024
28893a4
fix: force-redeploy on
abelr20 Aug 22, 2024
1bee0ed
feat: add wait for service to run
abelr20 Aug 22, 2024
7d1053d
feat: add prod and dev uri/url, minor updates to README
abelr20 Aug 22, 2024
076323d
fix: clean homepage
abelr20 Aug 22, 2024
21e2eb5
fix: fix workflow url
abelr20 Aug 22, 2024
4812502
Update authAPI.ts
abelr20 Aug 22, 2024
7fd3208
Update LoginButton.tsx
abelr20 Aug 22, 2024
e61c769
fix: sleep 10 before checking website status
abelr20 Aug 23, 2024
608c4c8
fix: sleep 30 before website status check
abelr20 Aug 23, 2024
c41a0c0
fix: workflow message updates
abelr20 Aug 23, 2024
e064364
fix: workflow clean up
abelr20 Aug 23, 2024
6f6234e
fix: add 10 seconds sleep
abelr20 Aug 23, 2024
936434b
Merge branch 'dev' into Abel/Deploy
abelr20 Sep 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Deploy to AWS ECS

on:
push:
branches: ['Abel/Deploy'] # Update to push to 'main' when complete

concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true

env:
ECR_REPOSITORY: app # Set this to your Amazon ECR repository name
ECS_SERVICE: SkyDevOps # Set this to your Amazon ECS service name
ECS_CLUSTER: Sky # Set this to your Amazon ECS cluster name

permissions:
contents: read

jobs:
deploy:
name: Deploy to AWS ECS
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
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: Login to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build and push new Docker image to AWS ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: latest
run: |
# Use Docker Buildx to build the image for x86_64
docker buildx build --platform linux/amd64 --push -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .

echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "Docker image $ECR_REPOSITORY:$IMAGE_TAG has been built and pushed to $ECR_REGISTRY"

- name: Deploy to AWS ECS
run: |
# Update the ECS service
aws ecs update-service --cluster ${{ env.ECS_CLUSTER }} --service ${{ env.ECS_SERVICE }} --force-new-deployment

# Define the website URL and the desired status code
WEBSITE_URL="https://skyscraper-api.com"
EXPECTED_STATUS_CODE=200

# Loop until the website returns the expected status code
# Wait 30 seconds before sending request
sleep 30
while true; do
# Send a HEAD request to the website and capture the HTTP status code
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" $WEBSITE_URL)

# Check if the status code matches the expected status code
if [ "$HTTP_STATUS" -eq "$EXPECTED_STATUS_CODE" ]; then
echo "Website is back up with status code $HTTP_STATUS"
break
else
echo "Website down. Current status code: $HTTP_STATUS"
fi

# Wait 20 seconds before the next check
sleep 20
done
echo "Website online"
echo "Deployment successful"
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20
FROM public.ecr.aws/docker/library/node:20-alpine

# Set the working directory
WORKDIR /usr/src/app
Expand All @@ -7,13 +7,14 @@ WORKDIR /usr/src/app
COPY package*.json ./

# Install dependencies
RUN npm install -g npm@latest
RUN npm install

# Copy the rest of the application code
COPY ./client ./client
COPY ./server ./server

# Build the client and server
# Build the server and client
RUN npm run build:server
RUN npm run build:prd

Expand Down
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<p align="center">
<a href="https://github.com/oslabs-beta/SkyScraper">
<img src="./client/src/assets/images/CircleLogo.png" alt="Logo" height="100">
<img src="images/CircleLogo.png" alt="Logo" height="100">
</a>

<h3 align="center">SkyScraper</h3>
Expand All @@ -15,7 +15,7 @@
Visualizer Dashboard for AWS EC2 Instances
<br />
<a href="https://github.com/oslabs-beta/SkyScraper/issues">Report Bug</a>
·
|
<a href="https://github.com/oslabs-beta/SkyScraper/issues">Request Feature</a>

</p>
Expand Down Expand Up @@ -56,7 +56,7 @@

<br/>
<p align="center">
<img width="900" src="./client/src/assets/images/FlatLogo.png">
<img width="900" src="images/FlatLogo.png">
</p>

SkyScraper is an innovative visualizer dashboard that transforms the way developers interact with AWS performance data, starting with EC2. By offering a streamlined, intuitive interface, SkyScraper optimizes the retrieval, organization, and visualization of performance metrics, enabling users to manage their AWS environments effectively.
Expand All @@ -67,17 +67,17 @@ Designed with a focus on clarity and aesthetics, SkyScraper features custom them

### Built With

- [<img style="height: 1em;" src="./client/src/assets/images/TS.png">](https://www.typescriptlang.org/) [TypeScript](https://www.typescriptlang.org/)
- [<img style="height: 1em;" src="./client/src/assets/images/React.png">](https://reactjs.org/) [React](https://reactjs.org/)
- [<img style="height: 1em;" src="./client/src/assets/images/Redux.png">](https://redux-toolkit.js.org/) [Redux](https://redux-toolkit.js.org/)
- [<img style="height: 1em;" src="./client/src/assets/images/Nodejs.png">](https://nodejs.org/en) [Node.js](https://nodejs.org/en)
- [<img style="height: 1em;" src="./client/src/assets/images/Express.png">](https://expressjs.com/) [Express](https://expressjs.com/)
- [<img style="height: 1em;" src="./client/src/assets/images/Chartjs.png">](https://www.chartjs.org/) [Chart.js](https://www.chartjs.org/)
- [<img style="height: 1em;" src="./client/src/assets/images/WebPack.png">](https://webpack.js.org/) [Webpack](https://webpack.js.org/)
- [<img style="height: 1em;" src="./client/src/assets/images/Auth0.png">](https://auth0.com/) [Auth0](https://auth0.com/)
- [<img style="height: 1em;" src="./client/src/assets/images/Cognito.png">](https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/Welcome.html) [AWS Cognito API](https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/Welcome.html)
- [<img style="height: 1em;" src="./client/src/assets/images/CloudWatch.png">](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html) [AWS CloudWatch API](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html)
- [<img style="height: 1em;" src="./client/src/assets/images/EC2.png">](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Welcome.html) [AWS EC2 API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Welcome.html)
- [<img style="height: 1em;" src="images/TS.png">](https://www.typescriptlang.org/) [TypeScript](https://www.typescriptlang.org/)
- [<img style="height: 1em;" src="images/React.png">](https://reactjs.org/) [React](https://reactjs.org/)
- [<img style="height: 1em;" src="images/Redux.png">](https://redux-toolkit.js.org/) [Redux](https://redux-toolkit.js.org/)
- [<img style="height: 1em;" src="images/Nodejs.png">](https://nodejs.org/en) [Node.js](https://nodejs.org/en)
- [<img style="height: 1em;" src="images/Express.png">](https://expressjs.com/) [Express](https://expressjs.com/)
- [<img style="height: 1em;" src="images/Chartjs.png">](https://www.chartjs.org/) [Chart.js](https://www.chartjs.org/)
- [<img style="height: 1em;" src="images/Webpack.png">](https://webpack.js.org/) [Webpack](https://webpack.js.org/)
- [<img style="height: 1em;" src="images/Auth0.png">](https://auth0.com/) [Auth0](https://auth0.com/)
- [<img style="height: 1em;" src="images/Cognito.png">](https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/Welcome.html) [AWS Cognito API](https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/Welcome.html)
- [<img style="height: 1em;" src="images/CloudWatch.png">](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html) [AWS CloudWatch API](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html)
- [<img style="height: 1em;" src="images/EC2.png">](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Welcome.html) [AWS EC2 API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Welcome.html)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Expand Down Expand Up @@ -150,25 +150,25 @@ Distributed under the MIT License. See [`LICENSE`](https://github.com/oslabs-bet

## Creators

[<img style="height: 1em; width: 1em;" src="./client/src/assets/images/GitHubWhite.png">](https://github.com/abelr20) [<img style="height: 1em; width: 1em;" src="./client/src/assets/images/LinkedIn.png">](https://www.linkedin.com/in/abel-ratanaphan/) Abel Ratanaphan
[<img style="height: 1em; width: 1em;" src="images/GitHubWhite.png">](https://github.com/abelr20) [<img style="height: 1em; width: 1em;" src="images/LinkedIn.png">](https://www.linkedin.com/in/abel-ratanaphan/) Abel Ratanaphan

[<img style="height: 1em; width: 1em;" src="./client/src/assets/images/GitHubWhite.png">](https://github.com/b-the-coder) [<img style="height: 1em; width: 1em;" src="./client/src/assets/images/LinkedIn.png">](https://www.linkedin.com/in/bin-emma-he/) Bin He
[<img style="height: 1em; width: 1em;" src="images/GitHubWhite.png">](https://github.com/b-the-coder) [<img style="height: 1em; width: 1em;" src="images/LinkedIn.png">](https://www.linkedin.com/in/bin-emma-he/) Bin He

[<img style="height: 1em; width: 1em;" src="./client/src/assets/images/GitHubWhite.png">](https://github.com/ChristieLaf) [<img style="height: 1em; width: 1em;" src="./client/src/assets/images/LinkedIn.png">](https://www.linkedin.com/in/christie-laferriere/) Christie Laferriere
[<img style="height: 1em; width: 1em;" src="images/GitHubWhite.png">](https://github.com/ChristieLaf) [<img style="height: 1em; width: 1em;" src="images/LinkedIn.png">](https://www.linkedin.com/in/christie-laferriere/) Christie Laferriere

[<img style="height: 1em; width: 1em;" src="./client/src/assets/images/GitHubWhite.png">](https://github.com/TrippMurphy) [<img style="height: 1em; width: 1em;" src="./client/src/assets/images/LinkedIn.png">](https://www.linkedin.com/in/trippmurphy/) Tripp Murphy
[<img style="height: 1em; width: 1em;" src="images/GitHubWhite.png">](https://github.com/TrippMurphy) [<img style="height: 1em; width: 1em;" src="images/LinkedIn.png">](https://www.linkedin.com/in/trippmurphy/) Tripp Murphy

[<img style="height: 1em; width: 1em;" src="./client/src/assets/images/GitHubWhite.png">](https://github.com/Nikolaa92) [<img style="height: 1em; width: 1em;" src="./client/src/assets/images/LinkedIn.png">](https://www.linkedin.com/in/nikola-andelkovic/) Nikola Andelkovic
[<img style="height: 1em; width: 1em;" src="images/GitHubWhite.png">](https://github.com/Nikolaa92) [<img style="height: 1em; width: 1em;" src="images/LinkedIn.png">](https://www.linkedin.com/in/nikola-andelkovic/) Nikola Andelkovic

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Contact Us

<img style="height: 1em; width: 1em;" src="./client/src/assets/images/Mail.png"> [email protected]
<img style="height: 1em; width: 1em;" src="images/Mail.png"> [email protected]

[<img style="height: 1em; width: 1em;" src="./client/src/assets/images/XWhite.png">]() [@SkyScraperApp](https://x.com/SkyScraperApp)
[<img style="height: 1em; width: 1em;" src="images/XWhite.png">]() [@SkyScraperApp](https://x.com/SkyScraperApp)

[<img style="height: 1em; width: 1em;" src="./client/src/assets/images/GitHubWhite.png">]() [github.com/oslabs-beta/SkyScraper](https://github.com/oslabs-beta/SkyScraper/)
[<img style="height: 1em; width: 1em;" src="images/GitHubWhite.png">]() [github.com/oslabs-beta/SkyScraper](https://github.com/oslabs-beta/SkyScraper/)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Expand Down
Binary file added client/public/favicon.ico
Binary file not shown.
11 changes: 9 additions & 2 deletions client/public/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
</html>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SkyScraper</title>

<!-- Ionicons for icons -->
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
<link rel="icon" href="../src/assets/images/CircleLogo.png" />

<!-- Favicon -->
<link rel="icon" href="favicon.ico" />

<!-- Preconnect for Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Overpass+Mono:[email protected]&display=swap" rel="stylesheet">
</head>

Expand Down
2 changes: 1 addition & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DashboardPage from './features/dashboard/DashboardPage';
import EC2MonitorPage from './features/ec2Monitor/EC2MonitorPage';
import NavBar from './features/navbar/Navbar';
import './styles/styles.css';
import './styles/Navbar.css';
import './styles/Nav.css';
import './styles/LoginPage.css';
import './styles/HomePage.css';

Expand Down
Loading