Skip to content

Instantly share code, notes, and snippets.

@git-bhanu
Last active August 5, 2020 17:19
Show Gist options
  • Save git-bhanu/9bab199b66c9580c711da15c37cf4606 to your computer and use it in GitHub Desktop.
Save git-bhanu/9bab199b66c9580c711da15c37cf4606 to your computer and use it in GitHub Desktop.
Deploying Roots(WordPress Starter theme) to your host using Github Actions
name: Deployment
on:
push:
branches: [ production ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1.1.0
with:
version: 12.x
- name: Install dependencies
run: |
composer install -o
yarn
- name: Build
run: yarn build
- name: Sync
env:
dest: 'root@111.11.111.111:/var/www/html/wp-content/themes/theme-name'
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}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment