From 441f2768df7149796384cc4a2a8449f74868c621 Mon Sep 17 00:00:00 2001 From: eunhak Date: Tue, 2 Jul 2024 01:38:35 +0900 Subject: [PATCH] cd fix --- .github/workflows/cd-aws.yml | 15 ++++++--------- .github/workflows/cd.yml | 2 ++ ecosystem.config.js | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cd-aws.yml b/.github/workflows/cd-aws.yml index 4911368..5ddbb25 100644 --- a/.github/workflows/cd-aws.yml +++ b/.github/workflows/cd-aws.yml @@ -27,7 +27,7 @@ jobs: with: context: . push: true - tags: ${{ secrets.DOCKER_USERNAME }}/nextjs-app:latest + tags: ${{ secrets.DOCKER_USERNAME }}/vite-react-app:latest - name: Logout from Docker Hub run: docker logout @@ -49,17 +49,14 @@ jobs: run: | ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} << 'EOF' # Pull the latest Docker image - docker pull ${{ secrets.DOCKER_USERNAME }}/nextjs-app:latest + docker pull ${{ secrets.DOCKER_USERNAME }}/vite-react-app:latest # Stop the currently running container - docker stop nextjs-app || true + docker stop vite-react-app || true # Remove the stopped container - docker rm nextjs-app || true + docker rm vite-react-app || true - # Run the new container - docker run -d -p 3000:3000 --name nextjs-app ${{ secrets.DOCKER_USERNAME }}/nextjs-app:latest - - # Restart PM2 to apply the new Docker container - pm2 restart all + # Run the new container with PM2 + docker run -d -p 3000:3000 --name vite-react-app ${{ secrets.DOCKER_USERNAME }}/vite-react-app:latest EOF diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 82f40c8..770071b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -18,6 +18,8 @@ jobs: run: apk add ruby && gem install mustache - name: creates output run: sh ./build.sh + - name: Copy cd-aws.yml to output + run: cp .github/workflows/cd-aws.yml output/cd-aws.yml - name: Pushes to another repository id: push_directory uses: cpina/github-action-push-to-another-repository@main diff --git a/ecosystem.config.js b/ecosystem.config.js index d8a49e8..bcf1b4c 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -1,3 +1,4 @@ +/*eslint no-undef: "off"*/ module.exports = { apps: [ {