From 91c6478cd73c9966efdde71716dc8aa77c206b9e Mon Sep 17 00:00:00 2001 From: Thinley Date: Sun, 20 Oct 2024 15:05:18 +0530 Subject: [PATCH] FEAT: Added deploy workflow --- .github/workflows/deploy.yml | 30 +++++++++++++++++++++++++ docker/Dockerfile.web => web/Dockerfile | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml rename docker/Dockerfile.web => web/Dockerfile (91%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0331721 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,30 @@ +name: Build and Deploy to Docker Hub + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Check Out Repo + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./web/Dockerfile + push: true + tags: thinley44/dchat-web:latest # Replace with your Docker Hub username and repository + + - name: Verify Pushed Image + run: docker pull thinley44/dchat-web:latest # Replace with your Docker Hub username and repository diff --git a/docker/Dockerfile.web b/web/Dockerfile similarity index 91% rename from docker/Dockerfile.web rename to web/Dockerfile index 23468da..d913da0 100644 --- a/docker/Dockerfile.web +++ b/web/Dockerfile @@ -2,7 +2,7 @@ FROM node:20.12.0-alpine3.19 WORKDIR /app -COPY ./web . +COPY . . RUN npm install