Skip to content

Commit

Permalink
chore: cd 파이프라인 버전 정보 추출 step 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
psychology50 committed May 30, 2024
1 parent 398fc9f commit 0ce2c44
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/deploy-batch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,36 @@ jobs:
with:
ref: ${{ github.event.push.base_ref }}

# 2. 자바 환경 설정
# 2. 버전 정보 추출 (태그 정보에서 *.*.*만 추출)
- name: Get Version
id: get_version
run: |
RELEASE_VERSION_WITHOUT_V="$(cut -d'v' -f2 <<< ${GITHUB_REF#refs/*/})"
echo "VERSION=$RELEASE_VERSION_WITHOUT_V" >> $GITHUB_OUTPUT
# 3. 자바 환경 설정
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

# 3. Build Gradle
# 4. Build Gradle
- name: Build Gradle
run: |
chmod +x ./gradlew
./gradlew :pennyway-batch:build --parallel --stacktrace --info -x test
shell: bash

# 4. Docker 이미지 build 및 push
# 5. Docker 이미지 build 및 push
- name: docker build and push
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t pennyway/pennyway-batch ./pennyway-batch
docker push pennyway/pennyway-batch
docker push pennyway/pennyway-batch:${{ steps.get_version.outputs.VERSION }}
docker push pennyway/pennyway-batch:latest
# 5. AWS SSM을 통한 Run-Command (Docker 이미지 pull 후 docker-compose를 통한 실행)
# 6. AWS SSM을 통한 Run-Command (Docker 이미지 pull 후 docker-compose를 통한 실행)
- name: AWS SSM Send-Command
uses: peterkimzz/aws-ssm-send-command@master
id: ssm
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/deploy-external-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,44 @@ jobs:
with:
ref: ${{ github.event.push.base_ref }}

# 2. 자바 환경 설정
# 2. 버전 정보 추출 (태그 정보에서 *.*.*만 추출)
- name: Get Version
id: get_version
run: |
RELEASE_VERSION_WITHOUT_V="$(cut -d'v' -f2 <<< ${GITHUB_REF#refs/*/})"
echo "VERSION=$RELEASE_VERSION_WITHOUT_V" >> $GITHUB_OUTPUT
# 3. 자바 환경 설정
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

# 3. FCM Admin SDK 파일 생성
# 4. FCM Admin SDK 파일 생성
- name: Create Json
uses: jsdaniell/[email protected]
with:
name: ${{ secrets.FIREBASE_ADMIN_SDK_FILE }}
json: ${{ secrets.FIREBASE_ADMIN_SDK }}
dir: ${{ secrets.FIREBASE_ADMIN_SDK_DIR }}

# 4. Build Gradle
# 5. Build Gradle
- name: Build Gradle
run: |
chmod +x ./gradlew
./gradlew :pennyway-app-external-api:build --parallel --stacktrace --info -x test
shell: bash

# 5. Docker 이미지 build 및 push
# 6. Docker 이미지 build 및 push
- name: docker build and push
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -t pennyway/pennyway-was ./pennyway-app-external-api
docker push pennyway/pennyway-was
docker push pennyway/pennyway-was:${{ steps.get_version.outputs.VERSION }}
docker push pennyway/pennyway-was:latest
# 6. AWS SSM을 통한 Run-Command (Docker 이미지 pull 후 docker-compose를 통한 실행)
# 7. AWS SSM을 통한 Run-Command (Docker 이미지 pull 후 docker-compose를 통한 실행)
- name: AWS SSM Send-Command
uses: peterkimzz/aws-ssm-send-command@master
id: ssm
Expand Down

0 comments on commit 0ce2c44

Please sign in to comment.