-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from AwkwardLiSFan/7-automate-deployment
feat: automate deployment
- Loading branch information
Showing
19 changed files
with
352 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Deploy | ||
run-name: Deploy to AWS | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- 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: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: ng run user-interface:ngsscbuild:production | ||
|
||
- name: Deploy | ||
run: | ||
aws s3 sync ./dist/user-interface ${{ secrets.S3_BUCKET }} --region ${{ secrets.AWS_DEFAULT_REGION }} --delete | ||
echo "Invalidating Old Distribution" | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths '/*' | ||
echo "Deployed Successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/app/components/applications-table/applications-table.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="statistics-container"> | ||
<mat-card class="stats-card" *ngFor="let card of statsData"> | ||
<h1 style="margin-top: 0px">{{ card.header }}</h1> | ||
<p class="card-text">{{ card.text }}</p> | ||
</mat-card> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.stats-card { | ||
border-radius: 20px; | ||
background-image: linear-gradient( | ||
to top, | ||
#ecf4d7 0%, | ||
#ecf4d7 60%, | ||
#daec37 83% | ||
); | ||
width: 300px; | ||
height: 200px; | ||
padding: 10px; | ||
text-align: center; | ||
} | ||
|
||
.card-text { | ||
font-size: 20px; | ||
margin-top: 15%; | ||
} | ||
|
||
.statistics-container { | ||
margin-top: 20px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
@media only screen and (max-width: 1100px) { | ||
.statistics-container { | ||
flex-direction: column; | ||
} | ||
|
||
.stats-card { | ||
width: 250px; | ||
height: 150px; | ||
margin: 20px; | ||
background-image: linear-gradient( | ||
to top, | ||
#ecf4d7 0%, | ||
#ecf4d7 50%, | ||
#daec37 83% | ||
); | ||
} | ||
|
||
.card-text { | ||
margin-top: 5%; | ||
font-size: 14px; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/app/components/statistics/statistics.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from "@angular/core/testing"; | ||
|
||
import { StatisticsComponent } from "./statistics.component"; | ||
|
||
describe("StatisticsComponent", () => { | ||
let component: StatisticsComponent; | ||
let fixture: ComponentFixture<StatisticsComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [StatisticsComponent], | ||
}); | ||
fixture = TestBed.createComponent(StatisticsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it("should create", () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component, Input } from "@angular/core"; | ||
import { StatisticsCard } from "src/app/pages/home/home.component"; | ||
|
||
@Component({ | ||
selector: "app-statistics", | ||
templateUrl: "./statistics.component.html", | ||
styleUrls: ["./statistics.component.scss"], | ||
}) | ||
export class StatisticsComponent { | ||
@Input() | ||
statsData: StatisticsCard[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
<div class="app-container"> | ||
<app-header></app-header> | ||
<app-statistics [statsData]="statCards!"></app-statistics> | ||
<div class="table-container"> | ||
<app-applications-table class="applications-table"></app-applications-table> | ||
<app-applications-table | ||
class="applications-table" | ||
[dataSource]="dataSource" | ||
></app-applications-table> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
.table-container { | ||
margin-top: 20px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
|
Oops, something went wrong.