Skip to content

Commit

Permalink
[fix] #12 - workflow 수정 (#13)
Browse files Browse the repository at this point in the history
* [#12] fix: docker 로그인 변수명 환경에 따라 분리

* [#12] fix(dev-CI): docker 로그인 테스트 목적으로 명령어 추가

* [#12] fix: workflow env 지정

* [#12] fix(dev-CI): docker login test 제외
  • Loading branch information
hyerinhwang-sailin authored Jan 14, 2025
1 parent de2003f commit 75db86f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/dev-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
CI:
runs-on: ubuntu-22.04
environment: dev

steps:
- name: Checkout
Expand Down Expand Up @@ -34,16 +35,16 @@ jobs:
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DEV_DOCKERHUB_USERNAME }}
password: ${{ secrets.DEV_DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile-dev
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DEV_REPONAME }}
tags: ${{ secrets.DEV_DOCKERHUB_USERNAME }}/${{ secrets.DEV_REPONAME }}

CD:
needs: [CI]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dev-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
environment: dev

steps:
- name: Checkout
Expand All @@ -26,4 +27,4 @@ jobs:
- name: build with gradle
run: |
chmod +x gradlew
./gradlew clean build -x test
./gradlew clean build -x test
7 changes: 4 additions & 3 deletions .github/workflows/prod-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
CI:
runs-on: ubuntu-22.04
environment: prod

steps:
- name: Checkout
Expand Down Expand Up @@ -34,16 +35,16 @@ jobs:
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.PROD_DOCKERHUB_USERNAME }}
password: ${{ secrets.PROD_DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile-prod
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.PROD_REPONAME }}
tags: ${{ secrets.PROD_DOCKERHUB_USERNAME }}/${{ secrets.PROD_REPONAME }}

CD:
needs: [CI]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prod-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
environment: prod

steps:
- name: Checkout
Expand Down

0 comments on commit 75db86f

Please sign in to comment.