generated from alleyinteractive/create-wordpress-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (40 loc) · 1.31 KB
/
built-tag.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
name: Create a -built tag
on:
push:
tags:
- 'v*.*.*'
- '!*-built'
jobs:
built-branch:
name: Create Built Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Clear previous vendor
shell: bash
run: rm -rf vendor && rm -rf composer.lock
- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: 8.0
version: 2
args: --prefer-dist --no-dev
- name: Extract branch name
shell: bash
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
id: vars
- name: Push to -built branch
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILT_BRANCH: '${{ steps.vars.outputs.tag }}-built'
TAG_NAME: '${{ steps.vars.outputs.tag }}-built'
run: |
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR"
rm -rf .gitignore docker_tag output.log .github
mv .deployignore .gitignore
git checkout -b $BUILT_BRANCH
git add -A && git commit -m "Built changes for $TAG_NAME"
git tag -a "$TAG_NAME" -m "Build assets for $TAG_NAME"
git push origin "refs/tags/$TAG_NAME"