Skip to content

Commit

Permalink
Merge pull request #3 from kusitms-28th-Meetup-E/main
Browse files Browse the repository at this point in the history
[release] contents
  • Loading branch information
seungueonn authored Feb 21, 2024
2 parents 0353939 + ccac4a5 commit c4b70c8
Show file tree
Hide file tree
Showing 7 changed files with 216 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ name: Java CI with Gradle

on:
push:
branches: [ "prod-1" ]
branches: [ "prod-apigateway" ]
pull_request:
branches: [ "prod-1" ]
branches: [ "prod-apigateway" ]

jobs:
build:
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/prod-community-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: CommunityService

on:
push:
branches: [ "prod-community" ]
pull_request:
branches: [ "prod-community" ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

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

- name: Make application.yml
run: |
mkdir -p src/main/resources
echo "$APPLICATION_COMMUNITY" > src/main/resources/application.yml
env:
APPLICATION: ${{ secrets.APPLICATION_COMMUNITY }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build -x test

- name: Docker build
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t app .
docker tag app ${{ secrets.DOCKER_USERNAME }}/community:latest
docker push ${{ secrets.DOCKER_USERNAME }}/community:latest
- name: docker-compose.yml
uses: appleboy/scp-action@master
with:
username: ec2-user
host: ${{ secrets.HOST }}
key: ${{ secrets.PRIVATE_KEY_3 }}
port: ${{ secrets.PORT }}
source: "./docker-compose-community.yml"
target: "/home/ec2-user/"

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_PROD_3 }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY_3 }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/community:latest
docker image prune -a -f
docker-compose up -d
69 changes: 69 additions & 0 deletions .github/workflows/prod-contents-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "prod-contents" ]
pull_request:
branches: [ "prod-contents" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Clean Gradle Cache
run: ./gradlew clean

- name: Make application.yml
run: |
mkdir -p src/main/resources
echo "$APPLICATION" > src/main/resources/application.yml
env:
APPLICATION: ${{ secrets.APPLICATION_CONTENTS }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build -x test

- name: Docker build
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t app .
docker tag app ${{ secrets.DOCKER_USERNAME }}/contents:latest
docker push ${{ secrets.DOCKER_USERNAME }}/contents:latest
- name: docker-compose.yml
uses: appleboy/scp-action@master
with:
username: ec2-user
host: ${{ secrets.HOST_PROD_2 }}
key: ${{ secrets.PRIVATE_KEY_CONTENTS }}
port: ${{ secrets.PORT }}
source: "./docker-compose-contents.yml"
target: "/home/ec2-user/"

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_CONTENTS }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY_CONTENTS }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/contents:latest
docker image prune -a -f
docker-compose up -dons/dependency-submission@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ name: Java CI with Gradle

on:
push:
branches: [ "prod-1" ]
branches: [ "prod-eureka" ]
pull_request:
branches: [ "prod-1" ]
branches: [ "prod-eureka" ]

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ name: Java CI with Gradle

on:
push:
branches: [ "prod-2" ]
branches: [ "prod-keyword" ]
pull_request:
branches: [ "prod-2" ]
branches: [ "prod-keyword" ]

jobs:
build:
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/prod-member-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: MemberService

on:
push:
branches: [ "prod-member" ]
pull_request:
branches: [ "prod-member" ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

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

- name: Make application.yml
run: |
mkdir -p src/main/resources
echo "$APPLICATION_MEMBER" > src/main/resources/application.yml
env:
APPLICATION: ${{ secrets.APPLICATION_MEMBER }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build -x test

- name: Docker build
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t app .
docker tag app ${{ secrets.DOCKER_USERNAME }}/member:latest
docker push ${{ secrets.DOCKER_USERNAME }}/member:latest
- name: docker-compose.yml
uses: appleboy/scp-action@master
with:
username: ec2-user
host: ${{ secrets.HOST }}
key: ${{ secrets.PRIVATE_KEY_3 }}
port: ${{ secrets.PORT }}
source: "./docker-compose-member.yml"
target: "/home/ec2-user/"

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_PROD_3 }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY_3 }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/member:latest
docker image prune -a -f
docker-compose up -d
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## 광장 리팩토링✨💗

0 comments on commit c4b70c8

Please sign in to comment.