-
Notifications
You must be signed in to change notification settings - Fork 35
52 lines (43 loc) · 1.75 KB
/
build.yml
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
name: Build and push to build branch.
on:
push:
branches:
- trunk
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
cache: yarn
- name: Set PHP version
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
with:
php-version: 7.4
coverage: none
tools: composer:v2
- name: Install PHP dependencies
run: |
composer install
- name: Install JS dependencies
run: |
yarn
- name: Build
run: yarn workspaces run build
- name: Ignore .gitignore
run: |
git add public_html/wp-content/themes/pattern-directory/css/* --force
git add public_html/wp-content/themes/pattern-directory/build --force || exit 0
git add public_html/wp-content/plugins/pattern-*/build --force
- name: Commit and push
# Using a specific hash here instead of a tagged version, for risk mitigation, since this action modifies our repo.
uses: actions-js/push@9624971e5ca3184618b29686baf638e14f65bd14
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: build
force: true
message: 'Build: ${{ github.sha }}'