Created
October 16, 2022 11:19
-
-
Save TheJotob/2efe34e7da1ed044033bf91b74fe1aec to your computer and use it in GitHub Desktop.
Wordpress Deployment Github Action
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
# 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