Skip to content

Commit

Permalink
add prod deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
rotchajunior committed Sep 18, 2024
1 parent ea76594 commit 225e0af
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy Main
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Sync
env:
dest: '${{vars.USER}}@${{vars.HOST}}:${{vars.THEMEPATHPROD}}'
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 /.github/ \
--exclude /node_modules/ \
./ ${{env.dest}}
- name: SSH Remote Commands
uses: appleboy/[email protected]
with:
host: ${{vars.HOST}}
username: ${{vars.USER}}
key: ${{secrets.DEPLOY_KEY}}
script: |
cd ${{vars.THEMEPATHPROD}}
git checkout main
wp theme activate site-america-aberta --allow-root
wp nginx-helper purge-all --allow-root

0 comments on commit 225e0af

Please sign in to comment.