From a7ad5d46cdfb4a8c25b3dc3263a29c3c582d37eb Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 3 Jun 2024 16:46:24 +0300 Subject: [PATCH 1/6] Create omar.yml --- .github/workflows/omar.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/omar.yml diff --git a/.github/workflows/omar.yml b/.github/workflows/omar.yml new file mode 100644 index 00000000..864b28ba --- /dev/null +++ b/.github/workflows/omar.yml @@ -0,0 +1,24 @@ +name: build and push to docker-hub +on: + push: + branches: + - omar +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: omar8magdy + password: "${{ secrets.DOCKERHUB_TOKEN }}" + + - name: Build Docker image + run: | + docker build -t omar . + docker tag omar omar8magdy/nodejs-test:omar + docker push omar8magdy/nodejs-test:omar + From 5288b1a14dbceb023ba151c67494b049bddf58a8 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:04:35 +0300 Subject: [PATCH 2/6] Delete .github/workflows/omar.yml --- .github/workflows/omar.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/omar.yml diff --git a/.github/workflows/omar.yml b/.github/workflows/omar.yml deleted file mode 100644 index 864b28ba..00000000 --- a/.github/workflows/omar.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: build and push to docker-hub -on: - push: - branches: - - omar -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: omar8magdy - password: "${{ secrets.DOCKERHUB_TOKEN }}" - - - name: Build Docker image - run: | - docker build -t omar . - docker tag omar omar8magdy/nodejs-test:omar - docker push omar8magdy/nodejs-test:omar - From 702bb1797606df411b2e5c969984eecd0e210d64 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:11:37 +0300 Subject: [PATCH 3/6] Create Dockerfile --- Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..7eab78e6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Use the official Node.js image as the base image +FROM node:5.0.0 + +# Set the working directory inside the container +WORKDIR /app + +# Copy the package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install the dependencies +RUN npm install + +# Copy the rest of the application files to the working directory +COPY . . + +# Build the Vue.js application for production +RUN npm run build + +# Use the official Nginx image to serve the Vue.js application +FROM nginx:alpine + +# Copy the built files from the previous stage to the Nginx web directory +COPY --from=0 /app/dist /usr/share/nginx/html + +# Expose port 80 +EXPOSE 80 + +# Start Nginx +CMD ["nginx", "-g", "daemon off;"] From 5f2cc70e62d86e40204a1bd8f92b5686cabfe6b7 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:18:44 +0300 Subject: [PATCH 4/6] Update Dockerfile From 258a164fdc71b01b7d541930757ee148d90d3c59 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:38:35 +0300 Subject: [PATCH 5/6] Create vue.yml --- .github/workflows/vue.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/vue.yml diff --git a/.github/workflows/vue.yml b/.github/workflows/vue.yml new file mode 100644 index 00000000..d7a8ab3c --- /dev/null +++ b/.github/workflows/vue.yml @@ -0,0 +1,24 @@ +name: build and push to docker hub +on: + push: + branches: + - omar +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: omar8magdy + password: "${{ secrets.DOCKERHUB_TOKEN }}" + + - name: Build Docker image + run: | + docker build -t Omar . + docker tag Omar omar8magdy/vue-test:Omar + docker push omar8magdy/vue-test:Omar + From 6579058c567e3709b6ea1de9c80d5e64a9105ad6 Mon Sep 17 00:00:00 2001 From: OmarMagdy94 <130608904+OmarMagdy94@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:41:38 +0300 Subject: [PATCH 6/6] Update vue.yml --- .github/workflows/vue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vue.yml b/.github/workflows/vue.yml index d7a8ab3c..1ef8196c 100644 --- a/.github/workflows/vue.yml +++ b/.github/workflows/vue.yml @@ -18,7 +18,7 @@ jobs: - name: Build Docker image run: | - docker build -t Omar . + docker build -t omar . docker tag Omar omar8magdy/vue-test:Omar docker push omar8magdy/vue-test:Omar