Skip to content

Commit

Permalink
[chore] yml파일 관리를 위한 submodule 도입 (#12)
Browse files Browse the repository at this point in the history
* [chore] add submodule for yml

* [chore] edit build.gradle to import yml from submodule

* [chore] edit build.gradle to import yml from submodule

* [chore] edit build.gradle to import yml from submodule

* [chore] edit ci workflow to use submodule

* [chore] edit cd workflow to use submodule

* [chore] fix typo in workflows

* [chore] fix typo in workflows
  • Loading branch information
Parkjyun authored Jul 4, 2024
1 parent e57fcb1 commit d517fd3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/dev-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GIT_SECRET }}
submodules: true

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

- name: create secret config file
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION_DEV }}" > ./application-dev.yml
- name: build with gradle
run: |
chmod +x gradlew
Expand All @@ -46,7 +44,7 @@ jobs:
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DEV_REPONAME }}

CD:
needs: [CI]
needs: CI
runs-on: ubuntu-22.04

steps:
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GIT_SECRET }}
submodules: true

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

- name: create secret config file
run: |
cd src/main/resources
echo "${{ secrets.APPLICATION_DEV }}" > ./application-dev.yml
- name: build with gradle
run: |
chmod +x gradlew
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "server-yml"]
path = server-yml
url = https://github.com/Team-Hankki/server-yml.git
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

tasks.register('copyYml', Copy) {
copy {
from './server-yml'
include "*.yml"
into 'src/main/resources'
}
}
1 change: 1 addition & 0 deletions server-yml
Submodule server-yml added at a7d6b4

0 comments on commit d517fd3

Please sign in to comment.