You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3
-
4
-
name: Node.js CI
1
+
name: Node.js CI and Deploy to GitHub Pages
5
2
6
3
on:
7
4
push:
@@ -10,8 +7,7 @@ on:
10
7
branches: [ "master" ]
11
8
12
9
jobs:
13
-
build:
14
-
10
+
build-and-deploy:
15
11
runs-on: ubuntu-latest
16
12
17
13
strategy:
@@ -21,15 +17,22 @@ jobs:
21
17
22
18
steps:
23
19
- uses: actions/checkout@v4
20
+
24
21
- name: Use Node.js ${{ matrix.node-version }}
25
22
uses: actions/setup-node@v3
26
23
with:
27
24
node-version: ${{ matrix.node-version }}
28
25
cache: 'npm'
26
+
29
27
- run: npm ci
28
+
29
+
- run: npm test # Ajoute cette ligne pour exécuter les tests
30
+
30
31
- run: npm run build --if-present
32
+
31
33
- name: Deploy to GitHub Pages
34
+
if: success() # Ajoute cette condition pour déployer uniquement si les tests et la build réussissent
32
35
uses: peaceiris/actions-gh-pages@v3
33
36
with:
34
-
github_token: ${{ secrets.BS_TOKEN }}
37
+
github_token: ${{ secrets.GITHUB_TOKEN }}# Assurez-vous d'utiliser le secret GITHUB_TOKEN
0 commit comments