55 push :
66 branches :
77 - main
8- - develop
98
109jobs :
1110 # 개발 환경
1211 build-and-push-dev :
13- runs-on : ubuntu-latest
14- if : github.ref == 'refs/heads/main'
12+ runs-on : ubuntu-latest
1513 environment : development
1614 steps :
1715 - name : Print environment variables
1816 run : |
1917 echo "Current Environment: ${{ github.environment }}"
20- echo "POSTGRESQL_POSTGRES_PASSWORD is set : ${{ secrets.POSTGRESQL_POSTGRES_PASSWORD }}"
18+ echo "POSTGRESQL_POSTGRES_PASSWORD is set : ${{ var.TZ }}"
2119
2220 -
2321 name : Set up QEMU
@@ -43,54 +41,13 @@ jobs:
4341 uses : docker/build-push-action@v6
4442 with :
4543 # 빌드 컨텍스트 : . 은 레포지토리 ROOT 디렉터리를 의미한다.
46- context : .
47- file : Dockerfile
44+ context : ./
45+ file : ./ Dockerfile
4846 build-args : |
4947 PROFILE=${{ vars.PROFILE }}
5048 env :
5149 POSTGRESQL_POSTGRES_PASSWORD=${{ secrets.POSTGRESQL_POSTGRES_PASSWORD || 'default-value' }}
5250
5351 push : true # 이미지를 레지스트리에 푸시합니다.
5452 tags : ${{ secrets.DOCKERHUB_USERNAME }}/loan-postgres:${{ github.sha }}
55- platforms : linux/amd64,linux/arm64,linux/arm/v7
56-
57- # 운영 환경
58- build-and-push-prod :
59- runs-on : ubuntu-latest
60- if : github.ref == 'refs/heads/develop'
61- environment : production
62- steps :
63- -
64- name : Set up QEMU
65- # 다중 플랫폼(Docker) 이미지를 빌드할 수 있도록 해준다.
66- uses : docker/setup-qemu-action@v3
67-
68- -
69- name : Set up Docker Buildx
70- uses : docker/setup-buildx-action@v3
71- # Docker Buildx를 설정합니다.
72-
73- -
74- name : Login to Docker Hub
75- uses : docker/login-action@v3
76- with :
77- username : ${{ secrets.DOCKERHUB_USERNAME }}
78- # GitHub Secret에서 Docker Hub 사용자 이름을 가져옵니다.
79- password : ${{ secrets.DOCKERHUB_TOKEN }}
80- # GitHub Secret에서 Docker Hub 액세스 토큰을 가져옵니다.
81-
82- -
83- name : Build and Push
84- uses : docker/build-push-action@v2
85- with :
86- # 빌드 컨텍스트 : Dockerfile이 있는 위치
87- context : .
88- # Dockerfile의 경로
89- file : Dockerfile
90- build-args : |
91- PROFILE=${{ vars.PROFILE }}
92- env :
93- POSTGRESQL_POSTGRES_PASSWORD=${{ secrets.POSTGRESQL_POSTGRES_PASSWORD || 'default-value' }}
94- push : true # 이미지를 레지스트리에 푸시합니다.
95- tags : ${{ secrets.DOCKERHUB_USERNAME }}/loan-postgres:${{ github.sha }}
9653 platforms : linux/amd64,linux/arm64,linux/arm/v7
0 commit comments