Skip to content

Commit 27f7628

Browse files
authored
Merge pull request #16 from Automattic/feature/use-actions-for-composer-and-build
Generate and upload `vendor` and `build` directories via actions.
2 parents 75d2fcd + af54c42 commit 27f7628

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

.git-ftp-include

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!build/
2+
!vendor/

.github/workflows/deploy-to-prod.yml

+20
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@ jobs:
1818
- uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 2
21+
22+
- name: Use Node.js 18
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: '18'
26+
27+
- name: Build Project
28+
run: |
29+
npm install
30+
npm run build --if-present
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: '7.4'
36+
tools: composer:v2
37+
38+
- name: Install Composer dependencies
39+
run: composer install --no-dev --optimize-autoloader
40+
2141
- name: FTP-Deploy-Action
2242
uses: Automattic/[email protected]
2343
with:

.github/workflows/deploy-to-staging.yml

+20
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ jobs:
2020
- uses: actions/checkout@v3
2121
with:
2222
fetch-depth: 2
23+
24+
- name: Use Node.js 18
25+
uses: actions/setup-node@v2
26+
with:
27+
node-version: '18'
28+
29+
- name: Build Project
30+
run: |
31+
npm install
32+
npm run build --if-present
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: '7.4'
38+
tools: composer:v2
39+
40+
- name: Install Composer dependencies
41+
run: composer install --no-dev --optimize-autoloader
42+
2343
- name: FTP-Deploy-Action
2444
uses: Automattic/[email protected]
2545
with:

composer.json

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
"phpcompatibility/phpcompatibility-wp": "*"
99
},
1010
"scripts": {
11+
"build": [
12+
"composer update --no-dev",
13+
"composer dump-autoload -o --no-dev"
14+
],
15+
"dev": [
16+
"composer update",
17+
"composer dump-autoload"
18+
],
1119
"lint": "./vendor/bin/phpcs --standard=phpcs.xml -n"
1220
},
1321
"autoload": {

0 commit comments

Comments
 (0)