This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
54 lines (44 loc) · 1.44 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
53
54
name: Aliucord CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@master
- name: Checkout builds branch
uses: actions/checkout@master
with:
ref: builds
path: builds
- uses: pnpm/action-setup@v2 # Install pnpm using packageManager key in package.json
- name: Use Node.js 17
uses: actions/setup-node@v2
with:
node-version: 17
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build aliucord
run: pnpm lint && pnpm build
- 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/*
- name: Upload dist folder to builds branch
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch
run: |
cd builds
cp ../dist/* .
cp ../data.json .
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git pull
git add -A
git commit -m "Build $GITHUB_SHA" || true
git push