Bump react-router-dom from 7.0.2 to 7.1.5 #162
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit test | |
on: | |
push: | |
branches: | |
- '**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build project | |
run: npm run build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts | |
path: ./dist | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
environment: recette | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: ./dist | |
- name: Install http-server | |
run: npm install --save-dev http-server | |
- name: Start HTTP server | |
run: npx http-server ./dist -p 8080 & | |
env: | |
CI: true | |
- name: Run Cypress tests and Browserslist | |
run: npm run test | |
env: | |
CYPRESS_baseUrl: http://localhost:8080 | |
- name: Upload Cypress screenshots | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots | |
deploy: | |
runs-on: ubuntu-latest | |
needs: test | |
environment: production | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: ./dist | |
- name: Copy build directory to server | |
uses: Dylan700/sftp-upload-action@v1.2.3 | |
with: | |
server: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
password: ${{ secrets.SERVER_PASSWORD }} | |
port: ${{ secrets.SERVER_PORT }} | |
uploads: | | |
./dist => /var/www/modelec.club | |
delete: true |