Skip to content

chore: add scripts for photo, user service #1

chore: add scripts for photo, user service

chore: add scripts for photo, user service #1

name: ์‚ฌ์ง„ ์„œ๋น„์Šค ๋นŒ๋“œ ํ›„ ๋„์ปคํ—ˆ๋ธŒ์— ์˜ฌ๋ฆฌ๊ธฐ
on:
push:
branches: [ 'main' ]
# paths:
# - 'photo-service/**' # API Gateway ๋ชจ๋“ˆ ๋ณ€๊ฒฝ
env:
SPRING_PROFILE: prod
IMAGE_NAME: spinachpasta/photo-service
MODULE_PATH: photo-service
SERVER_PORT: 8080
concurrency:
group: photo-service
jobs:
prepare-variables:
name: ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ค€๋น„ํ•˜๊ธฐ
runs-on: ubuntu-latest
outputs:
image-tag: ${{ steps.setup-env.outputs.image-tag }}
module-path: ${{ steps.setup-env.outputs.module-path }}
spring-profile: ${{ steps.setup-env.outputs.spring-profile }}
server-port: ${{ steps.setup-env.outputs.server-port }}
image-name: ${{ steps.setup-env.outputs.image-name }}
steps:
- name: GitHub ์—์„œ ๋ ˆํฌ ๋ฐ›์•„์˜ค๊ธฐ
uses: actions/checkout@v3
- name: ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ถœ๋ ฅํ•˜๊ธฐ
id: setup-env
run: |
echo "image-tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "module-path=$MODULE_PATH" >> $GITHUB_OUTPUT
echo "spring-profile=$SPRING_PROFILE" >> $GITHUB_OUTPUT
echo "server-port=$SERVER_PORT" >> $GITHUB_OUTPUT
echo "image-name=$IMAGE_NAME" >> $GITHUB_OUTPUT
call-build-workflow:
if: github.event_name == 'push'
needs: [ prepare-variables ]
name: ์ด๋ฏธ์ง€ ๋นŒ๋“œ & ํ‘ธ์‰ฌ
uses: ./.github/workflows/jib-build.yaml
permissions:
id-token: write
contents: read
with:
spring-profile: ${{ needs.prepare-variables.outputs.spring-profile }}
server-port: ${{ needs.prepare-variables.outputs.server-port }}
image-name: ${{ needs.prepare-variables.outputs.image-name }}
image-tag: ${{ needs.prepare-variables.outputs.image-tag }}
module-path: ${{ needs.prepare-variables.outputs.module-path }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}