more theme cleanup #44
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
# Experimental workflow to test GitHub Actions. | |
name: Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Deploy to Production | |
runs-on: ubuntu-20.04 | |
environment: | |
name: production | |
url: https://purpleturtlecreative.com/ | |
steps: | |
# Download All Code. | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
token: ${{ secrets.PTC_GITHUB_PAT }} | |
# Build the site theme. | |
- name: WordPress Theme - Build install | |
working-directory: ./wp-content/themes/purple-turtle-creative | |
run: ./build_install.sh | |
shell: bash | |
- name: WordPress Theme - Build cleanup | |
working-directory: ./wp-content/themes/purple-turtle-creative | |
run: ./build_cleanup.sh | |
shell: bash | |
# Build Completionist Pro. | |
- name: Completionist Pro - Build install | |
working-directory: ./wp-content/plugins/completionist-pro | |
run: ./build_install.sh | |
shell: bash | |
- name: Completionist Pro - Build cleanup | |
working-directory: ./wp-content/plugins/completionist-pro | |
run: ./build_cleanup.sh | |
shell: bash | |
# Remove unnecessary files and directories. | |
- name: Clean Up | |
run: | | |
find . -name '.git*' -exec rm -rf {} + -depth | |
find . -type d -empty -delete | |
# Upload Code to Production. | |
- name: Sync Code to Production | |
env: | |
remote: "github@${{ secrets.PTC_PROD_HOSTNAME }}" | |
destination: "/var/www/html" | |
run: | | |
echo "${{ secrets.PTC_GITHUB_SSH_KEY }}" > deploy_key | |
chmod 600 ./deploy_key | |
rsync --recursive --links --checksum --delete \ | |
--exclude-from="./exclude.lst" \ | |
-e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ | |
./wp-content ${{ env.remote }}:${{ env.destination }} | |
ssh -i ./deploy_key -o StrictHostKeyChecking=no ${{ env.remote }} 'chmod -R 775 ${{ env.destination }}/wp-content; chgrp -R www-data ${{ env.destination }}/wp-content' || true |