diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 973f3ee1..c232ff7f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,12 +3,12 @@ name: Deploy David KRK Site on: push: branches: [gh-pages] + pull_request: + branches: [gh-pages] workflow_dispatch: permissions: contents: read - pages: write - id-token: write concurrency: group: "pages" @@ -17,6 +17,8 @@ concurrency: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout uses: actions/checkout@v4 @@ -34,14 +36,25 @@ jobs: run: npm run build - name: Setup Pages + if: github.event_name == 'push' uses: actions/configure-pages@v4 + - name: Remove node_modules before upload + if: github.event_name == 'push' + run: rm -rf node_modules + - name: Upload artifact + if: github.event_name == 'push' uses: actions/upload-pages-artifact@v3 with: path: '.' deploy: + if: github.event_name == 'push' + permissions: + contents: read + pages: write + id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} @@ -50,4 +63,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index 5c1c8ac0..a375584c 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -1,2 +1,32 @@ -# Workflow désactivé temporairement pour éviter les conflits avec deploy.yml -# Le workflow deploy.yml gère maintenant tous les déploiements sur gh-pages +name: Site Build Check (no deploy) + +on: + pull_request: + branches: [gh-pages] + schedule: + - cron: '0 5 * * 1' + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: gh-pages + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci --prefer-offline --no-audit + + - name: Build site assets + run: npm run build