docs: add Pay Later / Pay Against Invoice app user guide (#63) #298
This file contains hidden or 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: Deploy to docs.j2commerce.com | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: # Allows manual trigger | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| NODE_OPTIONS: "--max_old_space_size=8192" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| run: | | |
| cd website | |
| npm install | |
| - name: Build website | |
| run: | | |
| cd website | |
| NODE_OPTIONS="--max_old_space_size=4096" npm run build | |
| - name: Create .htaccess for client-side routing | |
| run: | | |
| cd website | |
| mkdir -p build # Ensure directory exists | |
| cat > build/.htaccess << 'EOF' | |
| RewriteEngine On | |
| RewriteRule ^easy-checkout/easy-checkout/?$ /easy-checkout/easy-checkout-guide [R=301,L] | |
| RewriteRule ^index\.html$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule . /index.html [L] | |
| # Force HTTPS | |
| RewriteCond %{HTTPS} off | |
| RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
| # Cache static assets | |
| <IfModule mod_expires.c> | |
| ExpiresActive On | |
| ExpiresByType text/css "access plus 1 month" | |
| ExpiresByType application/javascript "access plus 1 month" | |
| ExpiresByType image/png "access plus 1 month" | |
| ExpiresByType image/jpg "access plus 1 month" | |
| ExpiresByType image/jpeg "access plus 1 month" | |
| ExpiresByType image/gif "access plus 1 month" | |
| ExpiresByType image/svg+xml "access plus 1 month" | |
| </IfModule> | |
| EOF | |
| - name: Deploy via FTP | |
| uses: SamKirkland/FTP-Deploy-Action@v4.3.4 | |
| with: | |
| server: ${{ secrets.FTP_SERVER }} | |
| username: ${{ secrets.FTP_USERNAME }} | |
| password: ${{ secrets.FTP_PASSWORD }} | |
| local-dir: ./website/build/ | |
| server-dir: /docs.j2commerce.com/ # Adjust to your actual path | |
| # REMOVED to avoid old files to be cleared first - put back if structure changed: dangerous-clean-slate: true | |
| - name: Notify on success | |
| if: success() | |
| run: echo "✅ Successfully deployed to https://docs.j2commerce.com" | |
| - name: Notify on failure | |
| if: failure() | |
| run: echo "❌ Deployment failed for https://docs.j2commerce.com - check the logs" |