Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release V2.3.4 #163

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3a7dd7d
feat: add more visiblity when test mode is turned on
shakee93 Sep 17, 2024
b8487ac
update readme text
shakee93 Sep 17, 2024
abed5fe
feat: minor refinement in the UI
shakee93 Sep 17, 2024
d98d234
feat: minify google fonts inline style
shakee93 Sep 17, 2024
faff118
Merge pull request #164 from shakee93/feat/test-mode-visibility
shakee93 Sep 18, 2024
ca11350
Merge remote-tracking branch 'origin/release/v2.3.4' into release/v2.3.4
shakee93 Sep 18, 2024
5818d19
test permissions
shakee93 Sep 18, 2024
0e22ded
update permission for cache folder too
shakee93 Sep 18, 2024
fbb30bc
update permission for cache folder too
shakee93 Sep 18, 2024
7501bd4
Merge branch 'release/v2.3.4' into test-permission
shakee93 Sep 18, 2024
51f50f5
update permission for cache folder too
shakee93 Sep 18, 2024
044c5c0
Merge branch 'release/v2.3.4' into test-permission
shakee93 Sep 18, 2024
f09fe71
rollback update permission for cache folder
shakee93 Sep 18, 2024
f2080d2
Merge branch 'release/v2.3.4' into test-permission
shakee93 Sep 18, 2024
2b9c86e
update permission
shakee93 Sep 18, 2024
38435bb
update permission
shakee93 Sep 18, 2024
4c97332
remove permission update clause
shakee93 Sep 18, 2024
2b9cfec
update file permission
shakee93 Sep 19, 2024
b318b15
Merge branch 'release/v2.3.4' into test-permission
shakee93 Sep 19, 2024
06fd7c8
update file permission
shakee93 Sep 19, 2024
01e048b
Merge branch 'release/v2.3.4' into test-permission
shakee93 Sep 19, 2024
d579de3
remove set wp-config.php permission step
shakee93 Sep 19, 2024
be29de2
rollback remove set wp-config.php permission step
shakee93 Sep 19, 2024
2897de5
update cache folder permission
shakee93 Sep 19, 2024
9056ebe
test rapidload cache store on directory creation
shakee93 Sep 19, 2024
b84aa4f
fix directory validation
shakee93 Sep 19, 2024
f4f7d44
update preload images when fetching page speed
shakee93 Sep 19, 2024
fb7d6de
Merge branch 'release/v2.3.4' into test-permission
shakee93 Sep 19, 2024
1a539b8
clear comments
shakee93 Sep 19, 2024
a8a9deb
update permission level
shakee93 Sep 19, 2024
8cf704e
update WordPress support version
shakee93 Sep 19, 2024
8a40619
Merge pull request #185 from shakee93/test-permission
shakee93 Sep 19, 2024
b5f07db
add pr env for linode server
shakee93 Sep 20, 2024
cda1b99
prevent lightsail pr from running
shakee93 Sep 20, 2024
aadea8b
update secret keys
shakee93 Sep 20, 2024
a6e82fc
add remaining steps
shakee93 Sep 20, 2024
9639ca1
update secret key
shakee93 Sep 20, 2024
ae2c027
update delete test env from linode action file
shakee93 Sep 20, 2024
67dd80a
prevent lightsail clean action file from running
shakee93 Sep 20, 2024
ec27729
Merge pull request #188 from shakee93/test-linode-pr
shakee93 Sep 23, 2024
852d1a7
fix: flush cache not working
shakee93 Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
pr-closed:
if: false # This will prevent the job from running
runs-on: ubuntu-latest

steps:
Expand Down
122 changes: 122 additions & 0 deletions .github/workflows/clean-wordpress-plugin-preview-linode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Clean Linode on Pull Request close

on:
pull_request:
types: [closed]

jobs:
pr-closed:
runs-on: ubuntu-latest

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

- name: Get the branch name
run: |
echo "Branch name: ${{ github.head_ref }}"

- name: Configure SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY_LINODE }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${{ secrets.SSH_HOST_LINODE }} 'echo SSH successfully configured'

- name: Set environment variables
run: |
echo "INSTANCE_ID=${{ github.event.number }}" >> $GITHUB_ENV

- name: Delete Nginx config
run: |
INSTANCE_ID=${{ github.event.number }}
CONFIG_FILE_NAME="pr-${INSTANCE_ID}.rapidload.live.conf"
TARGET_CONFIG_FILE_PATH="/etc/nginx/conf/vhosts/${CONFIG_FILE_NAME}" # Updated to correct Nginx path

ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${{ secrets.SSH_HOST_LINODE }} \
"if [ -f '$TARGET_CONFIG_FILE_PATH' ]; then \
echo 'Deleting $TARGET_CONFIG_FILE_PATH'; \
sudo rm '$TARGET_CONFIG_FILE_PATH'; \
else \
echo 'File $TARGET_CONFIG_FILE_PATH does not exist'; \
fi"

- name: Restart Nginx
run: |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${{ secrets.SSH_HOST_LINODE }} 'sudo systemctl restart nginx' # Correct Nginx restart command

#- name: Delete DNS A Record from Cloudflare
#run: |
#CF_API_TOKEN=${{ secrets.CF_API_TOKEN }}
#ZONE_ID=${{ secrets.CF_ZONE_ID }}
#RECORD_NAME=pr-${{ github.event.number }}

# Fetch the DNS record ID
#RECORD_ID=$(curl -X GET "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?type=A&name=${RECORD_NAME}" \
#-H "Authorization: Bearer ${CF_API_TOKEN}" \
#-H "Content-Type: application/json" | jq -r '.result[0].id')

# Check if the RECORD_ID is not null
#if [ -n "$RECORD_ID" ]; then
#echo "Deleting DNS record with ID $RECORD_ID"
#curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/${RECORD_ID}" \
#-H "Authorization: Bearer ${CF_API_TOKEN}" \
#-H "Content-Type: application/json"
#else
#echo "DNS record not found"
#fi

- name: Clean Docker WordPress
run: |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${{ secrets.SSH_HOST_LINODE }} << EOF
INSTANCE_ID=${{ github.event.number }}
WORDPRESS_PORT=$((3000 + INSTANCE_ID))
export INSTANCE_ID WORDPRESS_PORT

# Get the container IDs
WP_CONTAINER=\$(sudo docker ps -q --filter "name=wordpress_\${INSTANCE_ID}")
DB_CONTAINER=\$(sudo docker ps -q --filter "name=mariadb_\${INSTANCE_ID}")

echo "WP_CONTAINER ID: \${WP_CONTAINER}"
echo "DB_CONTAINER ID: \${DB_CONTAINER}"

# Stop and remove any existing Docker services using the same ports
if [ ! -z "\$WP_CONTAINER" ]; then
sudo docker stop \${WP_CONTAINER}
sudo docker rm \${WP_CONTAINER}
fi

if [ ! -z "\$DB_CONTAINER" ]; then
sudo docker stop \${DB_CONTAINER}
sudo docker rm \${DB_CONTAINER}
fi

# Remove existing volumes
WP_VOLUME=\$(sudo docker volume ls -q --filter name=wordpress_data_\${INSTANCE_ID})
if [ ! -z "\$WP_VOLUME" ]; then
sudo docker volume rm -f \${WP_VOLUME}
fi

DB_VOLUME=\$(sudo docker volume ls -q --filter name=mariadb_data_\${INSTANCE_ID})
if [ ! -z "\$DB_VOLUME" ]; then
sudo docker volume rm -f \${DB_VOLUME}
fi

EOF

- name: Delete docker-compose file
run: |
INSTANCE_ID=${{ github.event.number }}
SSH_HOST=${{ secrets.SSH_HOST }}

ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${SSH_HOST_LINODE} <<EOF
export INSTANCE_ID=${INSTANCE_ID}

if [ -d "/root/wp-${INSTANCE_ID}" ]; then # Updated path to root directory
echo "Directory exists. Deleting /root/wp-${INSTANCE_ID}..."
rm -r /root/wp-${INSTANCE_ID}
else
echo "Directory /root/wp-${INSTANCE_ID} does not exist. Skipping deletion."
fi
EOF
16 changes: 15 additions & 1 deletion .github/workflows/deploy-wordpress-plugin-preview-lightsail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
deploy:
if: false # This will prevent the job from running
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -212,10 +213,23 @@ jobs:
DOMAIN="pr-${INSTANCE_ID}.rapidload.live"
WP_CONTAINER=\$(sudo docker ps -q --filter "name=wordpress_\${INSTANCE_ID}")

# Grant 666 permissions to wp-config.php
# Grant 666 permissions to wp-config.php to cache folder
sudo docker exec -u root -i \${WP_CONTAINER} sh -c "chmod 666 /bitnami/wordpress/wp-config.php"
EOF

- name: Create cache folder and grant 777 permissions
if: ${{ github.event.action == 'opened' }}
run: |
ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa bitnami@${{ secrets.SSH_HOST }} << EOF
set -x
INSTANCE_ID=${{ github.event.number }}
DOMAIN="pr-${INSTANCE_ID}.rapidload.live"
WP_CONTAINER=\$(sudo docker ps -q --filter "name=wordpress_\${INSTANCE_ID}")

# Create cache folder if it doesn't exist and grant 755 permissions
sudo docker exec -u root -i \${WP_CONTAINER} sh -c "if [ ! -d /bitnami/wordpress/wp-content/cache ]; then mkdir -p /bitnami/wordpress/wp-content/cache; fi && chmod -R 755 /bitnami/wordpress/wp-content/cache"
EOF

- name: Update domain in wp-config.php
if: ${{ github.event.action == 'opened' }}
run: |
Expand Down
Loading
Loading