Skip to content

Commit

Permalink
Merge pull request #281 from TeamDilly/develop
Browse files Browse the repository at this point in the history
v1.7.0
  • Loading branch information
leeeeeyeon authored Sep 3, 2024
2 parents 67af437 + 9c97c2a commit 155a69a
Show file tree
Hide file tree
Showing 86 changed files with 2,969 additions and 1,959 deletions.
69 changes: 10 additions & 59 deletions .github/workflows/packy-cd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,15 @@ on:
branches:
- develop

permissions:
contents: read

jobs:
CD:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.ACTION_TOKEN }}
submodules: true

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Build with Gradle & Upload Image to ECR
run: ./gradlew -Pdev clean jib

- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYYMMDD_HH-mm-ss
utcOffset: "+09:00"

- name: Generate deployment package
run: |
mkdir -p deploy/.platform/nginx/conf.d
cp Dockerrun.aws.dev.json deploy/Dockerrun.aws.json
cp -r .ebextensions-dev deploy/.ebextensions
cp .platform/nginx/conf.d/proxy-dev.conf deploy/.platform/nginx/conf.d/proxy.conf
cd deploy && zip -r deploy.zip .
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: packy-dev-beanstalk
environment_name: Packy-dev-beanstalk-env
version_label: packy-dev-${{steps.current-time.outputs.formattedTime}}
region: ${{ secrets.AWS_REGION }}
deployment_package: deploy/deploy.zip
wait_for_environment_recovery: 200
name: Call Reusable Deploy Workflow
uses: ./.github/workflows/reusable-cd.yml
with:
profile: dev
secrets:
ACTION_TOKEN: ${{ secrets.ACTION_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
69 changes: 10 additions & 59 deletions .github/workflows/packy-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,18 @@ on:
branches:
- main

permissions:
contents: read

jobs:
CD:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.ACTION_TOKEN }}
submodules: true

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3

- name: Build with Gradle & Upload Image to ECR
run: ./gradlew -Pprod clean jib

- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYYMMDD_HH-mm-ss
utcOffset: "+09:00"

- name: Generate deployment package
run: |
mkdir -p deploy/.platform/nginx/conf.d
cp Dockerrun.aws.prod.json deploy/Dockerrun.aws.json
cp -r .ebextensions-prod deploy/.ebextensions
cp .platform/nginx/conf.d/proxy-prod.conf deploy/.platform/nginx/conf.d/proxy.conf
cd deploy && zip -r deploy.zip .
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: packy-prod-beanstalk
environment_name: Packy-prod-beanstalk-env
version_label: packy-prod-${{steps.current-time.outputs.formattedTime}}
region: ${{ secrets.AWS_REGION }}
deployment_package: deploy/deploy.zip
wait_for_environment_recovery: 200
name: Call Reusable Deploy Workflow
uses: ./.github/workflows/reusable-cd.yml
with:
profile: prod
secrets:
ACTION_TOKEN: ${{ secrets.ACTION_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# - name: Update Release
# uses: release-drafter/release-drafter@v5
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/packy-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
branches:
- main
- develop
push:
branches:
- main
- develop

permissions:
contents: read
Expand All @@ -29,13 +25,21 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Run build Flyway Module
run: ./gradlew clean packy-flyway:build

- name: Run FlywayApplication
run: java -Dspring.profiles.active=${{ env.PROFILE }} -jar ./packy-flyway/build/libs/packy-flyway-0.0.1-SNAPSHOT.jar
env:
PROFILE: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }}

- name: Run build with Gradle Wrapper
run: ./gradlew clean build --parallel

- name: Report to CodeCov
uses: codecov/codecov-action@v4
- name: Add coverage to PR
uses: madrapps/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: 'packy-support/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml'
paths: ${{ github.workspace }}/packy-support/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
token: ${{ secrets.ACTION_TOKEN }}
80 changes: 80 additions & 0 deletions .github/workflows/reusable-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Reusable Deploy Workflow

permissions:
contents: read
on:
workflow_call:
inputs:
profile:
type: string
required: true
secrets:
ACTION_TOKEN:
required: true
AWS_ACCESS_KEY:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
AWS_REGION:
required: true
CODECOV_TOKEN:
required: true

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.ACTION_TOKEN }}
submodules: true

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build with Gradle & Upload Image to ECR
run: ./gradlew -P${{ inputs.profile }} clean jib

- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYYMMDD_HH-mm-ss
utcOffset: "+09:00"

- name: Generate deployment package
run: |
mkdir -p deploy/.platform/nginx/conf.d
cp Dockerrun.aws.${{ inputs.profile }}.json deploy/Dockerrun.aws.json
cp -r .ebextensions-${{ inputs.profile }} deploy/.ebextensions
cp .platform/nginx/conf.d/proxy-${{ inputs.profile }}.conf deploy/.platform/nginx/conf.d/proxy.conf
cd deploy && zip -r deploy.zip .
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v22
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: packy-${{ inputs.profile }}-beanstalk
environment_name: Packy-${{ inputs.profile }}-beanstalk-env
version_label: packy-${{ inputs.profile }}-${{steps.current-time.outputs.formattedTime}}
region: ${{ secrets.AWS_REGION }}
deployment_package: deploy/deploy.zip
wait_for_environment_recovery: 200
Loading

0 comments on commit 155a69a

Please sign in to comment.