chore: update to dockerhub push #70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 데브 워크플로우 | |
on: | |
push: | |
branches: [ 'dev' ] | |
paths: | |
- 'gateway/**' # Gateway 모듈 변경 | |
- 'member/**' # Member 모듈 변경 | |
- 'common/**' # Common 모듈 변경 | |
- 'family/**' # Family 모듈 변경 | |
- 'post/**' # Post 모듈 변경 | |
- 'mission/**' # Mission 모듈 변경 | |
- '.github/workflows/**' # 워크플로우와 관련된 파일이 변경된 경우 | |
- 'build.gradle' # Parent Gradle 모듈 설정이 변경된 경우 | |
- 'settings.gradle' # Parent Gradle 설정이 변경된 경우 | |
env: | |
ECR_REPOSITORY_NAME: bibbi-backend-dev | |
SPRING_PROFILE: dev | |
ECS_SERVICE: bibbi-backend-development | |
ECS_CLUSTER: bibbi-cluster-prod | |
ECR_TASK_DEFINITION: bibbi-backend-dev | |
concurrency: | |
group: development | |
jobs: | |
prepare-variables: | |
name: 환경변수 준비하기 | |
runs-on: ubuntu-latest | |
outputs: | |
ecr-repository-name: ${{ steps.setup-env.outputs.ecr-repository-name }} | |
image-tag: ${{ steps.setup-env.outputs.image-tag }} | |
spring-profile: ${{ steps.setup-env.outputs.spring-profile }} | |
ecs-service: ${{ env.ECS_SERVICE }} | |
ecs-cluster: ${{ env.ECS_CLUSTER }} | |
ecr-task-definition: ${{ env.ECR_TASK_DEFINITION }} | |
steps: | |
- name: GitHub 에서 레포 받아오기 | |
uses: actions/checkout@v3 | |
- name: 환경변수 출력하기 | |
id: setup-env | |
run: | | |
echo "ecr-repository-name=$ECR_REPOSITORY_NAME" >> $GITHUB_OUTPUT | |
echo "image-tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
echo "spring-profile=$SPRING_PROFILE" >> $GITHUB_OUTPUT | |
echo "ecs-service=$ECS_SERVICE" >> $GITHUB_OUTPUT | |
echo "ecs-cluster=$ECS_CLUSTER" >> $GITHUB_OUTPUT | |
echo "ecr-task-definition=$ECR_TASK_DEFINITION" >> $GITHUB_OUTPUT | |
call-build-workflow: | |
if: github.event_name == 'push' | |
needs: [ prepare-variables ] | |
name: 이미지 빌드 | |
uses: ./.github/workflows/build-dockerhub.yaml | |
permissions: | |
id-token: write | |
contents: read | |
with: | |
image-name: no5ing/bibbi-backend-api-dev | |
image-tag: ${{ needs.prepare-variables.outputs.image-tag }} | |
spring-profile: ${{ needs.prepare-variables.outputs.spring-profile }} | |
secrets: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKER_PASSWORD }} | |
call-deploy-workflow: | |
if: github.event_name == 'push' | |
needs: [ prepare-variables, call-build-workflow ] | |
name: ArgoCD로 배포하기 | |
uses: ./.github/workflows/deploy-argocd.yaml | |
permissions: | |
contents: write | |
with: | |
argocd-repo-name: bibbi-team/bibbi-argocd-manifest | |
overlay-name: ${{ needs.prepare-variables.outputs.spring-profile }} | |
service-name: bibbi-backend-api | |
image-name: no5ing/bibbi-backend-api-dev | |
image-tag: ${{ needs.prepare-variables.outputs.image-tag }} | |
environment: development | |
default-image-name: no5ing/bibbi-backend-api | |
secrets: | |
PAT_TOKEN: ${{ secrets.PAT_TOKEN }} |