Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 10 additions & 30 deletions .github/workflows/deploy-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,8 @@ jobs:
sed -i 's|"PLUGINS PASSWORD"|"${{ secrets.PLUGINS_PASSWORD }}"|g' auth.json
cat auth.json

- name: Cache Vendor
id: app-deploy-cache-vendor
uses: actions/cache@v3
env:
cache-name: app-deploy-cache-vendor
with:
path: vendor
key: app-deploy-vendor-${{ runner.os }}-${{ hashFiles('composer.lock') }}
restore-keys: |
app-deploy-vendor-${{ runner.os }}-

- name: Cache Node Modules
id: app-deploy-cache-node_modules
uses: actions/cache@v3
env:
cache-name: app-deploy-cache-node_modules
with:
path: node_modules
key: app-deploy-node_modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
app-deploy-node_modules-${{ runner.os }}-

- name: Composer Install
run: composer install --no-dev -o
if: steps.app-deploy-cache-vendor.outputs.cache-hit != 'true'

- name: Install pnpm
uses: pnpm/action-setup@v4
Expand All @@ -61,7 +38,6 @@ jobs:

- name: pnpm install
run: pnpm install --prod
if: steps.app-deploy-cache-node_modules.outputs.cache-hit != 'true'

- name: pnpm build
run: pnpm build
Expand All @@ -73,12 +49,16 @@ jobs:

- name: 📂 Sync files to VPS using SSH
run: |
rsync -e "ssh -o StrictHostKeyChecking=no" -avz --no-times --update \
--exclude='node_modules' --exclude='package.json' --exclude='.git*' \
--exclude='src/scripts' --exclude='src/scss' --exclude='pint.json' \
--exclude='composer.lock' --exclude='sample*' --exclude='*.md' \
--exclude='*.yml' --exclude='*.yaml' --exclude=auth.json --exclude=config \
--exclude='pnpm*' --exclude='wp-cli*' ./* ${{ vars.SSH_USER_SERVER }}:${{ vars.TARGET_DIR }} --verbose
rsync -avz --no-times --update --delete \
--exclude='.nvmrc' \
--exclude='**/node_modules' \
--exclude='.git*' \
--exclude='auth.json' \
--exclude='**/package.json' \
--exclude='pint.json' \
--exclude='sample*' \
--exclude='*.md' \
./ ${{ vars.SSH_USER_SERVER }}:${{ vars.PROD_TARGET_DIR }}
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}

Expand Down
4 changes: 4 additions & 0 deletions wp-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
path: /var/www/html

@app:
ssh: docker:www-data@wp_app
Loading