diff --git a/.gitea/workflow/pipeline.yml b/.gitea/workflow/pipeline.yml new file mode 100644 index 0000000..e70e10c --- /dev/null +++ b/.gitea/workflow/pipeline.yml @@ -0,0 +1,31 @@ +version: "1" +name: Build and Deploy Docker Image + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to Gitea Container Registry + run: echo "${{ secrets.GITEA_PASSWORD }}" | docker login ${{ secrets.GITEA_REGISTRY }} -u ${{ secrets.GITEA_USERNAME }} --password-stdin + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ secrets.GITEA_REGISTRY }}/dotechbro-website:latest + + - name: Log out from Gitea Container Registry + run: docker logout ${{ secrets.GITEA_REGISTRY }} diff --git a/.gitignore b/.gitignore index a547bf3..2bd1803 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.env + # Logs logs *.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0112f8b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Use an official Node.js runtime as a parent image +FROM node:18 AS build + +# Set the working directory +WORKDIR /app + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application code +COPY . . + +# Build the application +RUN npm run build + +# Use an official Nginx image to serve the built application +FROM nginx:alpine + +# Copy the built application from the previous stage +COPY --from=build /app/dist /usr/share/nginx/html + +# Expose port 80 +EXPOSE 80 + +# Start Nginx +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/index.html b/index.html index 0c589ec..fc21b25 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,17 @@ -
- - - -