Skip to content

Commit

Permalink
chore: 일부 secret 이름 변경, dev.env 파일에 저장되는 변수명 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
bflykky committed Jul 30, 2024
1 parent c393e80 commit accba59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cicd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
touch ./application.yml
echo "${{ secrets.DEV_APPLICATION_YML }}" >> ./application.yml
echo "${{ secrets.APPLICATION_DEV_YML }}" >> ./application.yml
# 빌드 권한 부여
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

# docker image 빌드
- name: Build
run: docker build --no-cache -t ${{ secretes.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }}:${{ secrets.DOCKERHUB_TAG }} .
run: docker build --no-cache -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME }}:${{ secrets.DOCKERHUB_IMAGE_TAG }} .

# docker hub 로그인
- name: Docker Hub login
Expand All @@ -43,14 +43,14 @@ jobs:

# docker hub에 image push
- name: docker image push
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME}}:${{secrets.DOCKERHUB_TAG }}
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME}}:${{secrets.DOCKERHUB_IMAGE_TAG }}

# docker compose에 사용될 환경 변수들이 담긴 env 파일 세팅
- name: Set up environment variables
run: |
echo "DOCKER_USER_NAME=${{ secrets.DOCKERHUB_USERNAME }}" >> dev.env
echo "DOCKER_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}" >> dev.env
echo "DOCKER_IMAGE_NAME=${{ secrets.DOCKERHUB_IMAGE_NAME }}" >> dev.env
echo "DOCKER_IMAGE_TAG=${{ secrets.DOCKERHUB_TAG }}" >> dev.env
echo "DOCKER_IMAGE_TAG=${{ secrets.DOCKERHUB_IMAGE_TAG }}" >> dev.env
echo "SPRING_OUTER_PORT=${{ secrets.SPRING_OUTER_PORT }}" >> dev.env
echo "SPRING_INNER_PORT=${{ secrets.SPRING_INNER_PORT }}" >> dev.env
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
sudo docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN_READ_ONLY }}
sudo docker container stop naoman-dev
sudo docker container rm naoman-dev
sudo docker image rm ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME}}:${{secrets.DOCKERHUB_TAG }}
sudo docker image rm ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGE_NAME}}:${{secrets.DOCKERHUB_IMAGE_TAG }}
sudo docker compose --env-file dev.env -f compose.yml up -d
sudo docker container prune -f
sudo docker image prune -a -f
2 changes: 1 addition & 1 deletion compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
spring-application:
container_name: naoman-dev
image: ${DOCKER_USER_NAME}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}
image: ${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}
ports:
- ${SPRING_OUTER_PORT}:${SPRING_INNER_PORT}

Expand Down

0 comments on commit accba59

Please sign in to comment.