Merge pull request #1 from okfn-brasil/hml #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy HML | |
on: | |
push: | |
branches: [ hml ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Sync | |
env: | |
dest: '${{vars.USER}}@${{vars.HOST}}:${{vars.THEMEPATHDEV}}' | |
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.THEMEPATHDEV}} | |
git checkout hml | |
wp theme activate site-america-aberta --allow-root | |
wp nginx-helper purge-all --allow-root |