diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index e28af9d..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(dir \"C:\\\\Users\\\\anton\\\\Desktop\\\\studioVariable\\\\NTB\\\\nouveau-theatre-de-besancon\\\\site\\\\cache\")" - ] - } -} diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index a9da04a..24fb881 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -4,80 +4,43 @@ on: push: branches: - main - - preprod jobs: deploy: - name: Deploy + name: Deploy to Production runs-on: docker container: image: forgejo-ci-php:latest steps: - name: Checkout code run: | - git clone --depth 50 --branch ${{ github.ref_name }} https://oauth2:${{ github.token }}@forge.studio-variable.com/${{ github.repository }}.git . + git clone --depth 1 --branch main https://oauth2:${{ github.token }}@forge.studio-variable.com/${{ github.repository }}.git . - - name: Install dependencies + - name: Install Node.js and build assets + run: | + curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - + apt-get install -y -qq nodejs + npm install + npx gulp + + - name: Install PHP dependencies run: | composer install --no-dev --optimize-autoloader - - name: Set deploy host - id: host - shell: bash - run: | - if [ "${{ github.ref_name }}" = "preprod" ]; then - echo "ftp_host=${{ secrets.PREPRODUCTION_HOST }}" >> $GITHUB_OUTPUT - else - echo "ftp_host=${{ secrets.PRODUCTION_HOST }}" >> $GITHUB_OUTPUT - fi - - name: Deploy via FTP env: USERNAME: ${{ secrets.USERNAME }} PASSWORD: ${{ secrets.PASSWORD }} - FTP_HOST: ${{ steps.host.outputs.ftp_host }} - shell: bash + HOST: ${{ secrets.HOST }} run: | - BEFORE="${{ github.event.before }}" - ZEROS="0000000000000000000000000000000000000000" - - if [ "$BEFORE" != "$ZEROS" ] && git cat-file -e "${BEFORE}^{commit}" 2>/dev/null; then - INCREMENTAL=true - echo "=== Mode incrémental — fichiers modifiés depuis $BEFORE ===" - git diff --name-status "$BEFORE" HEAD - echo "============================================================" - else - INCREMENTAL=false - echo "=== Mode full mirror (premier push ou BEFORE hors portée) ===" - fi - - { - echo "set ftp:ssl-allow no" - echo "set cmd:fail-exit no" - echo "open -u $USERNAME,$PASSWORD $FTP_HOST" - - if $INCREMENTAL; then - git diff --name-status "$BEFORE" HEAD | while IFS=$'\t' read -r status file; do - case "$file" in local/*|site/accounts/*|site/cache/*|site/sessions/*) continue ;; esac - if [ "$status" = "D" ]; then - echo "rm -f \"$file\"" - elif [ -f "$file" ]; then - echo "mkdir -p \"$(dirname "$file")\"" - echo "put \"$file\" -o \"$file\"" - fi - done - else - echo "mirror --reverse --verbose --ignore-time --parallel=10 -x local/ assets assets" - echo "mirror --reverse --verbose --ignore-time --parallel=10 -x accounts/ -x cache/ -x sessions/ site site" - fi - - echo "mirror --reverse --verbose --ignore-time --parallel=10 kirby kirby" - echo "mirror --reverse --verbose --ignore-time --parallel=10 vendor vendor" - echo "quit" - } > /tmp/lftp-script.txt - - echo "=== Script lftp généré ===" - cat /tmp/lftp-script.txt - echo "==========================" - + apt-get install -y -qq lftp + cat > /tmp/lftp-script.txt < - - template() == 'sectioned'): ?> - - - isHomePage() && $site->infoBannerEnabled()->toBool()): ?> + isHomePage()): ?> diff --git a/site/snippets/nav.php b/site/snippets/nav.php index 7cf681e..94115ed 100644 --- a/site/snippets/nav.php +++ b/site/snippets/nav.php @@ -1,7 +1,7 @@