-
Notifications
You must be signed in to change notification settings - Fork 156
61 lines (56 loc) · 1.65 KB
/
build-stable.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
53
54
55
56
57
58
59
60
61
name: Build Stable Release
on:
push:
branches:
- trunk
jobs:
stable:
name: Push (merge) to trunk
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use desired version of NodeJS
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2, wp
- name: Clone stable branch to the release folder
env:
GITHUB_REPOSITORY: ${{ github.event.repository.name }}
run: |
git clone --depth 1 --branch stable https://github.com/$GITHUB_REPOSITORY.git release
cd release
git branch --show-current
mv .git $RUNNER_TEMP/.git
cd ..
- name: Check versions
run: |
npm -v
node -v
php -v
composer -v
- name: Install and build
run: |
composer install --no-dev
npm install
npm run release
- name: Push to Stable
env:
GITHUB_REPOSITORY: ${{ github.event.repository.name }}
GITHUB_SHA: ${{ github.event.commits[0].sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd release
mv $RUNNER_TEMP/.git .git
git branch --show-current
git config --global user.email "[email protected]"
git config --global user.name "10upbot on GitHub"
git remote set-url origin "https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git"
git add .
git commit -m "Committing built version of $GITHUB_SHA"
git push origin HEAD:stable