Skip to content

Commit

Permalink
Merge pull request #13 from themerous/themerous-patch-4
Browse files Browse the repository at this point in the history
Update deploy.yml
  • Loading branch information
themerous authored Jul 27, 2024
2 parents 4d7d63a + f7f586b commit 616e2a4
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,24 @@ jobs:

- name: Build Next.js app
run: pnpm build

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.NAVER_ACESSKEY }}
password: ${{ secrets.NAVER_SECRETKEY }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ secrets.REGISTRY_URL }}/react-app:latest

- name: Login then Build and push Docker image
run: |
docker login -u ${{ secrets.NAVER_ACESSKEY }} -p ${{ secrets.NAVER_SECRETKEY }} ${{ secrets.REGISTRY_URL }}
docker build -t themerous/react-app:latest .
docker push themerous/react-app:latest

- name: SSH and deploy
uses: appleboy/ssh-action@master
Expand All @@ -43,7 +52,7 @@ jobs:
password: ${{ secrets.SERVER_PASSWORD }}
script: |
docker login -u ${{ secrets.NAVER_ACCESSKEY }} -p ${{ secrets.NAVER_SECRETKEY }} ${{ secrets.REGISTRY_URL }}
docker pull themerous/react-app:latest
docker pull ${{ secrets.REGISTRY_URL }}/react-app:latest
docker stop react-app-container || true
docker rm react-app-container || true
docker run -d -p 80:3000 --name react-app-container themerous/react-app:latest
docker run -d -p 80:3000 --name react-app-container ${{ secrets.REGISTRY_URL }}/react-app:latest

0 comments on commit 616e2a4

Please sign in to comment.