-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into t1147-upgrade-prisma-…
…v6-new
- Loading branch information
Showing
187 changed files
with
12,719 additions
and
4,180 deletions.
There are no files selected for viewing
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,90 @@ | ||
name: RC - CD - Build Images | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
AWS_REGION: ap-northeast-2 | ||
ECS_CLUSTER: Codedang-Api | ||
|
||
permissions: # permissions to the job (for the OpenID Connection) | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
build-client-api: | ||
name: Build client-api image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_FOR_ECR_PUSH_RC }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Build and push image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
file: ./apps/backend/Dockerfile | ||
push: true | ||
build-args: | | ||
target=client | ||
app_env=production | ||
tags: ${{ steps.login-ecr.outputs.registry }}/codedang-client-api:latest | ||
|
||
build-admin-api: | ||
name: Build admin-api image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_FOR_ECR_PUSH_RC }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Build and push image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
file: ./apps/backend/Dockerfile | ||
push: true | ||
build-args: | | ||
target=admin | ||
app_env=production | ||
tags: ${{ steps.login-ecr.outputs.registry }}/codedang-admin-api:latest | ||
|
||
build-iris: | ||
name: Build iris Docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_FOR_ECR_PUSH_RC }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Build and push image (iris) | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
context: '{{defaultContext}}:apps/iris' | ||
build-args: | | ||
app_env=production | ||
tags: ${{ steps.login-ecr.outputs.registry }}/codedang-iris:latest |
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,66 @@ | ||
name: RC - Deploy - Target | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
terraform_project: | ||
description: 'Select Terraform Project to Deploy' | ||
required: true | ||
type: choice | ||
options: | ||
- 'network' | ||
- 'storage' | ||
- 'codedang' | ||
|
||
env: | ||
AWS_REGION: ap-northeast-2 | ||
ECS_CLUSTER: Codedang-Api | ||
|
||
permissions: # permissions to the job (for the OpenID Connection) | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
rc-deploy-target-project: | ||
name: RC - Deploy Terraform targeted Project | ||
runs-on: ubuntu-latest | ||
environment: production | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_FOR_DEPLOY_RC }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.5.2 | ||
|
||
- name: Create Terraform variable file | ||
working-directory: ./apps/infra/rc/${{ github.event.inputs.terraform_project }} | ||
run: | | ||
echo "$TFVARS_RC" >> terraform.tfvars | ||
echo "$OAUTH_GITHUB" >> terraform.tfvars | ||
echo "$OAUTH_KAKAO" >> terraform.tfvars | ||
echo 'env = "rc"' >> terraform.tfvars | ||
env: | ||
TFVARS_RC: ${{ secrets.TFVARS_RC }} | ||
OAUTH_GITHUB: ${{ secrets.OAUTH_GITHUB }} | ||
OAUTH_KAKAO: ${{ secrets.OAUTH_KAKAO }} | ||
|
||
- name: Terraform Init | ||
working-directory: ./apps/infra/rc/${{ github.event.inputs.terraform_project }} | ||
run: terraform init -backend-config="bucket=codedang-tf-state-rc" | ||
|
||
- name: Terraform Plan | ||
working-directory: ./apps/infra/rc/${{ github.event.inputs.terraform_project }} | ||
run: terraform plan -input=false -out=plan.out | ||
|
||
- name: Terraform Apply | ||
working-directory: ./apps/infra/rc/${{ github.event.inputs.terraform_project }} | ||
run: terraform apply -input=false plan.out |
Oops, something went wrong.