add: first CI/CD script
All checks were successful
Déploiement Docker Vite / deploy (push) Successful in 10m53s
All checks were successful
Déploiement Docker Vite / deploy (push) Successful in 10m53s
This commit is contained in:
parent
036df802d5
commit
3995b85c34
21
.gitea/workflows/deploy.yml
Normal file
21
.gitea/workflows/deploy.yml
Normal 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
19
Dockerfile
Normal 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;"]
|
||||
Loading…
Reference in New Issue
Block a user