Nouveau déploiement #79
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: Déploiement | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build le site | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Utiliser Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache de node modules | |
id: cache-nodemodules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: angular/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Installer les dépendences | |
working-directory: angular | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: | | |
npm ci | |
- name: Lint | |
working-directory: angular | |
run: npm run lint | |
- name: Build | |
working-directory: angular | |
run: npm run build:prod | |
- name: Fix 404.html | |
working-directory: angular/dist/depinfo | |
run: | | |
cp index.html 404.html | |
- name: Fix permissions | |
working-directory: angular/dist/depinfo | |
run: | | |
chmod -c -R +rX "./" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- name: Téléverser l'artéfact | |
id: upload-artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: github-pages | |
path: angular/dist/depinfo | |
retention-days: 1 | |
if-no-files-found: error | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |