Last active
August 5, 2020 17:19
-
-
Save git-bhanu/9bab199b66c9580c711da15c37cf4606 to your computer and use it in GitHub Desktop.
Deploying Roots(WordPress Starter theme) to your host using Github Actions
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: Deployment | |
on: | |
push: | |
branches: [ production ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/[email protected] | |
with: | |
version: 12.x | |
- name: Install dependencies | |
run: | | |
composer install -o | |
yarn | |
- name: Build | |
run: yarn build | |
- name: Sync | |
env: | |
dest: '[email protected]:/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