-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [aws] chore: Deploy to aws= * [aws] feat: User Profile
- Loading branch information
1 parent
80ba39f
commit be9fec1
Showing
28 changed files
with
395 additions
and
210 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
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,44 @@ | ||
name: Deploy Backend to AWS | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
defaults: | ||
run: | ||
working-directory: ./backend | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
run: | | ||
yarn docker:app:build | ||
docker tag notes-app-be:latest ${{ secrets.DOCKERHUB_USERNAME }}/notes-app-be:latest | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/notes-app-be:latest | ||
deploy: | ||
needs: build | ||
runs-on: ec2-runner-be | ||
steps: | ||
- name: Delete old be container | ||
run: docker rm -f notes-app-be | ||
- name: Delete old be image | ||
run: docker image rm -f ${{ secrets.DOCKERHUB_USERNAME }}notes-app-fe | ||
- name: Prune docker system | ||
run: docker system prune -f | ||
- name: Pull image from docker hub | ||
run: docker pull ${{ secrets.DOCKERHUB_USERNAME }}/notes-app-be:latest | ||
- name: Run docker container | ||
run: docker run -e DATABASE_URL=${{ secrets.PROD_DATABASE_URL }} -e JWT_SECRET=${{ secrets.JWT_SECRET }} -d -p 5000:5000 --name notes-app-be ${{ secrets.DOCKERHUB_USERNAME }}/notes-app-be:latest |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
name: Deploy Frontend to AWS | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
build: | ||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
run: | | ||
docker build --build-arg REACT_APP_API_BASE_URL=${{ secrets.REACT_APP_API_BASE_URL }} -t notes-app-fe . | ||
docker tag notes-app-fe:latest ${{ secrets.DOCKERHUB_USERNAME }}/notes-app-fe:latest | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/notes-app-fe:latest | ||
deploy: | ||
needs: build | ||
runs-on: ec2-runner-fe | ||
steps: | ||
- name: Delete old fe container | ||
run: docker rm -f notes-app-fe | ||
- name: Prune docker system | ||
run: docker system prune -f | ||
- name: Pull image from docker hub | ||
run: docker pull ${{ secrets.DOCKERHUB_USERNAME }}/notes-app-fe:latest | ||
- name: Run docker container | ||
run: docker run -e REACT_APP_API_BASE_URL=${{ secrets.REACT_APP_API_BASE_URL }} -d -p 3000:3000 --name notes-app-fe ${{ secrets.DOCKERHUB_USERNAME }}/notes-app-fe:latest |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
be9fec1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage for this commit
Coverage Report
be9fec1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage for this commit
Coverage Report