Skip to content

Instantly share code, notes, and snippets.

@TheJotob
Created October 16, 2022 11:19
Show Gist options
  • Save TheJotob/2efe34e7da1ed044033bf91b74fe1aec to your computer and use it in GitHub Desktop.
Save TheJotob/2efe34e7da1ed044033bf91b74fe1aec to your computer and use it in GitHub Desktop.
Wordpress Deployment Github Action
# In subdirectory .github/workflows
name: Deploy Website on master
on:
push:
branches:
- master
concurrency: production_environment
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Install composer dependencies
uses: php-actions/composer@v6
with:
dev: no
php_version: 7.4
- name: Copy production .htaccess
run: mv ./web/_production.htaccess ./web/.htaccess
- name: Deploy via Deployer
uses: deployphp/action@v1
with:
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
dep: deploy production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment