-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.85 KB
/
ci.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: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
name: Build plugins
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
registry-url: "https://registry.npmjs.org"
- name: Install pnpm
run: npm i -g pnpm
- name: Install dependencies
run: pnpm install
- name: Build plugins
run: pnpm buildAll
- name: Upload dist folder as artifact
uses: actions/upload-artifact@v3
if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was not triggered by the default branch
with:
name: dist
path: dist/*.{zip,json}
- name: Checkout builds
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch
uses: actions/checkout@master
with:
ref: "builds"
path: "builds"
- name: Push builds
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch
run: |
rm $GITHUB_WORKSPACE/builds/* || true # clean previous builds
cp dist/*.{zip,json} $GITHUB_WORKSPACE/builds
cd $GITHUB_WORKSPACE/builds
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add .
git commit -m "Build $GITHUB_SHA" || exit 0 # do not error if nothing to commit
git push