-
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.
- Loading branch information
Showing
24 changed files
with
1,110 additions
and
1,398 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 @@ | ||
.gitignore |
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,18 @@ | ||
#!/bin/bash | ||
echo "Running deploy script" | ||
|
||
TAG=$([ "$BRANCH" = "main" ] && echo "latest" || echo "dev") | ||
|
||
echo "Logging in to AWS" | ||
aws ecr get-login-password --region us-east-1 | \ | ||
docker login --username AWS --password-stdin "${AWS_ECR}" | ||
echo "Logged in successfully" | ||
|
||
echo "Building and tagging Docker image" | ||
docker build -t readux-dev --no-cache . | ||
docker tag readux-dev "${AWS_ECR}:${TAG}" | ||
|
||
echo "Pushing image" | ||
docker push "${AWS_ECR}:${TAG}" | ||
|
||
echo "Pushed succesfully" |
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,36 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
|
||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Checkout Docker configs | ||
run: | | ||
mv ./.github/workflows/deploy.sh . | ||
chmod +x deploy.sh | ||
- name: Configure AWS credentials from AWS account | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE }} | ||
aws-region: us-east-1 | ||
role-session-name: GitHub-OIDC-frontend | ||
|
||
- name: Run Deploy | ||
env: | ||
BRANCH: ${GITHUB_REF##*/} | ||
AWS_ECR: ${{ secrets.AWS_ECR }} | ||
run: ./deploy.sh |
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,8 @@ | ||
FROM node:20.12.1-slim | ||
WORKDIR /dxd | ||
COPY . . | ||
RUN rm package-lock.json | ||
RUN npm install | ||
RUN npm run build | ||
EXPOSE 3000 | ||
CMD ["npm", "start"] |
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.