Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions .github/workflows/ci/server.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@
name: Server micro service CI
name: CI

on:
workflow_dispatch:
inputs:
version:
description: '배포하고자 하는 버전을 입력해주세요. 최신 버전이라면 생략해주세요. (git commit id 앞 8자리)'
default: 'latest'
push:
branches: [ main ] # push 되었을 때, 실행

jobs:
build:
if: github.event.inputs.version == 'latest'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

name: checkout
run: git checkout ${{ github.event.inputs.version }}

- name: set up jdk 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'

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

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

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

- name: make api documents
run: ./gradlew --info server:openapi3
run: ./gradlew --info openapi3

- name: configure openapi3 spec
run: |
yq eval -i '.components.securitySchemes.bearerAuth.type = "http"' ./server/src/main/resources/static/openapi3.yaml
yq eval -i '.components.securitySchemes.bearerAuth.scheme = "bearer"' ./server/src/main/resources/static/openapi3.yaml
yq eval -i '.components.securitySchemes.bearerAuth.bearerFormat = "JWT"' ./server/src/main/resources/static/openapi3.yaml
yq eval -i '.security[0].bearerAuth = []' ./server/src/main/resources/static/openapi3.yaml

yq eval -i '.components.securitySchemes.bearerAuth.type = "http"' ./user/src/main/resources/static/openapi3.yaml
yq eval -i '.components.securitySchemes.bearerAuth.scheme = "bearer"' ./user/src/main/resources/static/openapi3.yaml
yq eval -i '.components.securitySchemes.bearerAuth.bearerFormat = "JWT"' ./user/src/main/resources/static/openapi3.yaml
yq eval -i '.security[0].bearerAuth = []' ./user/src/main/resources/static/openapi3.yaml

yq eval -i '.components.securitySchemes.bearerAuth.type = "http"' ./auth/src/main/resources/static/openapi3.yaml
yq eval -i '.components.securitySchemes.bearerAuth.scheme = "bearer"' ./auth/src/main/resources/static/openapi3.yaml
yq eval -i '.components.securitySchemes.bearerAuth.bearerFormat = "JWT"' ./auth/src/main/resources/static/openapi3.yaml
yq eval -i '.security[0].bearerAuth = []' ./auth/src/main/resources/static/openapi3.yaml

- name: push image using jib
run: ./gradlew --info server:jib
run: ./gradlew --info jib

tagging:
needs:
Expand All @@ -53,11 +56,7 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- if: github.event.inputs.version != 'latest'
name: checkout
run: git checkout ${{ github.event.inputs.version }}

- name: set image tag
- name: set tag
run: |
echo "IMAGE_TAG=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV

Expand All @@ -68,15 +67,17 @@ jobs:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ref: main

- name: edit infra repository image tag
- name: edit infra repository tag
run: |
echo 'env(IMAGE_TAG)'
yq eval -i '.service.tag = env(IMAGE_TAG)' ./charts/server/values.yaml
yq eval -i '.service.tag = env(IMAGE_TAG)' ./charts/user/values.yaml
yq eval -i '.service.tag = env(IMAGE_TAG)' ./charts/auth/values.yaml

- name: commit
uses: leigholiver/commit-with-deploy-key@v1.0.4
with:
source: .
destination_repo: kSideProject/kpring-infra
deploy_key: ${{ secrets.SSH_PRIVATE_KEY }}
commit_message: 'ci: update server image version=${{ github.event.inputs.version }}'
commit_message: 'ci: update tag to env(IMAGE_TAG)'
82 changes: 0 additions & 82 deletions .github/workflows/ci/auth.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .github/workflows/ci/front.yml

This file was deleted.

82 changes: 0 additions & 82 deletions .github/workflows/ci/user.yml

This file was deleted.

Loading