I have initialized the git repository in main Wordpress directory. I pushed my theme files on github and I am trying to rsync files with my web server using github actions.
For this purpose I created .yml file below:
# This is a basic workflow to help you get started with Actions
name: Deployment
# Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the "main" branch push:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Sync
env:
dest: 'path/public_html/wp-content/themes/webpack'
run: |
echo "${{secrets.DEPLOY_KEY}}" > deploy_key
chmod 600 ./deploy_key
rsync -chav --delete \
-e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \
--exclude /deploy_key \
--exclude /.git/ \
--exclude /.gitignore \
--exclude /.github/ \
--exclude /node_modules/ \
./ ${{env.dest}}
Please tell me guys how I can rsync Github repo subfolder /wp-content/themes/webpack with my theme path on web server 'path/public_html/wp-content/themes/webpack'? At this point I will receive nested folders on web server: path/public_html/wp-content/themes/webpack/wp-content/themes/webpack