Skip to content

Commit 113cf58

Browse files
deploy to github pages
1 parent bcfcf5a commit 113cf58

File tree

4 files changed

+380
-6
lines changed

4 files changed

+380
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,36 @@ name: Deploy React App to GitHub Pages
33
on:
44
push:
55
branches:
6-
- main
6+
- main # à chaque push sur main, le workflow se déclenche
77

88
jobs:
99
build-and-deploy:
1010
runs-on: ubuntu-latest
11+
1112
steps:
13+
# 1️⃣ Récupérer le code
1214
- name: Checkout repository
1315
uses: actions/checkout@v3
1416

17+
# 2️⃣ Installer Node.js
1518
- name: Setup Node.js
1619
uses: actions/setup-node@v3
1720
with:
18-
node-version: '19'
21+
node-version: '18' # tu peux changer selon ta version locale
1922

23+
# 3️⃣ Installer les dépendances
2024
- name: Install dependencies
2125
run: npm install
2226

27+
# 4️⃣ Build l'application
2328
- name: Build
2429
run: npm run build
2530

31+
# 5️⃣ Déployer sur GitHub Pages
2632
- name: Deploy
2733
uses: peaceiris/actions-gh-pages@v3
2834
with:
29-
github_token: ${{ secrets.GITHUB_TOKEN }}
30-
publish_dir: ./build
35+
personal_token: ${{ secrets.GH_PAT }} # PAT que tu crées dans GitHub secrets
36+
publish_dir: ./build # dossier React build
37+
user_name: "eren-the-coder"
38+
user_email: "[email protected]"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
automatisation.md

0 commit comments

Comments
 (0)