-
Notifications
You must be signed in to change notification settings - Fork 6
80 lines (66 loc) · 2.38 KB
/
Copy pathdev.yml
File metadata and controls
80 lines (66 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Deploy to WPEngine - DEV
env:
WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_SSHG_KEY_PRIVATE }}
WPE_INSTALL_NAME: ${{ secrets.DEV_ENVIRONMENT }}
THEME_NAME: ${{ secrets.THEME_NAME }}
on:
push:
branches:
- dev
jobs:
js-build:
runs-on: ubuntu-latest
steps:
- name: Check out the git repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: wp-content/themes/${{ secrets.THEME_NAME }}/yarn.lock
- name: Install Yarn
run: npm install -g yarn
- name: Check for yarn.lock file
run: |
if [ ! -f wp-content/themes/${{ secrets.THEME_NAME }}/yarn.lock ]; then
echo "yarn.lock file is missing. Please ensure it exists in the specified directory."
exit 1
fi
- name: Install js/css dependencies
run: yarn install
working-directory: wp-content/themes/${{ secrets.THEME_NAME }}
- name: Build js/css
run: yarn build
working-directory: wp-content/themes/${{ secrets.THEME_NAME }}
- name: Clean up node modules (not needed to deploy)
run: rm -rf wp-content/themes/${{ secrets.THEME_NAME }}/node_modules
- name: Deploy to WPE
uses: wpengine/github-action-wpe-site-deploy@v3
with:
SCRIPT: post-deploy.sh
WPE_ENV: ${{ secrets.DEV_ENVIRONMENT }}
php-build:
runs-on: ubuntu-latest
container: php:8.2-alpine
steps:
- name: Check out the git repo
uses: actions/checkout@v4
- name: Set up Composer cache
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- name: Install PHP dependencies
run: |
cd wp-content/themes/${{ secrets.THEME_NAME }}
composer install --prefer-dist --no-scripts --no-interaction --optimize-autoloader
- name: Deploy to wpengine.com
uses: wpengine/github-action-wpe-site-deploy@v3
with:
SCRIPT: post-deploy.sh
WPE_ENV: ${{ secrets.DEV_ENVIRONMENT }}