Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordPress Dev

Use this wp repo

Use container for development

  • install wsl and ubuntu
  • install docker
  • docker compose up or docker compose up -d for detached mode
  • http://localhost:8000/wp-admin/

Attach to wordpress container:

  • docker ps ...get container ID
  • docker exec -it <container-id> /bin/bash

Access / dump database

Show db in client (e.g. datagrip):

  • host: localhost
  • port : 3309

Create db mysqldump:

docker ps
docker exec <container_id> sh -c 'exec mysqldump -u"username" -p"password" database_name' > database_backup.sql
docker exec my-mysql-container sh -c 'exec mysqldump -uroot -psomewordpress wordpress' > database_backup.sql

General WP remarks

Plugins

Example:

Deployment to prod

Manually

  • ssh user@your-production-server.com ...SSH into Your Production Server
  • cd /var/www/html ...Navigate to Your Web Root Directory
  • git clone https://github.com/your-username/my-wp-site.git . ...clone repo

CI/CI

e.g. github workflow. SSH private key as a secret in GitHub repository.

name: Deploy to Production

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Set up SSH
        uses: webfactory/ssh-agent@v0.5.3
        with:
          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

      - name: Deploy to Server
        run: |
          ssh user@your-production-server.com 'cd /var/www/html && git pull origin main && composer install && npm install && npm run build'

Post-Deployment Steps

  • Run Database Migrations (if applicable): If you're using a tool like WP Migrate DB or a custom migration script, run it to update your production database.
  • Clear Cache: Clear any caching plugins or CDN caches to ensure the latest changes are reflected.
  • Verify Deployment: Visit your production site and verify that everything is working as expected.
  • ``
  • ``
  • ``
  • ``
  • ``
  • ``

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages