add: first CI/CD script
All checks were successful
Déploiement Docker Vite / deploy (push) Successful in 10m53s

This commit is contained in:
Guams 2026-09-02 22:30:24 +02:00
parent 036df802d5
commit 3995b85c34
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,21 @@
name: Déploiement Docker Vite
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Clone the repo
uses: actions/checkout@v4
- name: Build docker image
run: docker build -t homepage .
- name: Delete old one
run: docker rm -f guams_homepage || true
- name: Run the container
run: docker run -d --name guams_homepage -p 8001:80 homepage

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM node:latest AS build
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:stable
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 8001
CMD ["nginx", "-g", "daemon off;"]