Skip to content

Commit

Permalink
[Setting] 깃헙 액션 파일 내 도커 변수 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jinkonu authored May 17, 2024
1 parent 12173e9 commit fe3d49e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,20 @@ jobs:
run: |
./planfit/gradlew build --project-dir ./planfit -x test
# docker variables debugging
- name: check docker variables
run: |
echo "DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}"
echo "DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}"
# docker login
- name: Docker login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}


# docker build & push to production
- name: Docker build & push to prod
if: contains(github.ref, 'main')
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/planfit:latest .
docker push ${{ secrets.DOCKER_USERNAME }}/planfit:latest
docker build -f Dockerfile -t ${{ secrets.DOCKERHUB_USERNAME }}/planfit .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/planfit
## deploy to production
- name: Deploy to prod
Expand Down

0 comments on commit fe3d49e

Please sign in to comment.