Skip to content

Commit 5b50d2e

Browse files
authored
Mise en ligne nouveau site web
Mise en ligne nouveau site web
1 parent 20d053d commit 5b50d2e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/workflows/node.js.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# 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
52

63
on:
74
push:
@@ -10,8 +7,7 @@ on:
107
branches: [ "master" ]
118

129
jobs:
13-
build:
14-
10+
build-and-deploy:
1511
runs-on: ubuntu-latest
1612

1713
strategy:
@@ -21,15 +17,22 @@ jobs:
2117

2218
steps:
2319
- uses: actions/checkout@v4
20+
2421
- name: Use Node.js ${{ matrix.node-version }}
2522
uses: actions/setup-node@v3
2623
with:
2724
node-version: ${{ matrix.node-version }}
2825
cache: 'npm'
26+
2927
- run: npm ci
28+
29+
- run: npm test # Ajoute cette ligne pour exécuter les tests
30+
3031
- run: npm run build --if-present
32+
3133
- name: Deploy to GitHub Pages
34+
if: success() # Ajoute cette condition pour déployer uniquement si les tests et la build réussissent
3235
uses: peaceiris/actions-gh-pages@v3
3336
with:
34-
github_token: ${{ secrets.BS_TOKEN }}
37+
github_token: ${{ secrets.GITHUB_TOKEN }} # Assurez-vous d'utiliser le secret GITHUB_TOKEN
3538
publish_dir: ./build

0 commit comments

Comments
 (0)