-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.22 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
name: Build Push
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Configure Git
run: |
git config --global user.name "${{ secrets.GH_USERNAME }}"
git config --global user.email "${{ secrets.GH_EMAIL }}"
mkdir -p ~/.ssh/
echo "${{ secrets.GH_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
git remote set-url origin git@github.com:${{ github.repository }}.git
git pull
git checkout -b build
- name: Create placeholder js file
run: |
mkdir -p dist
touch dist/ex124oj.user.js
git add -f dist/ex124oj.user.js
git commit -m "User script generating prepared"
- name: Build production js file
run: |
npm run build
git add -f dist/ex124oj.user.js
git commit -m "User script generating completed"
- name: Push to GitHub
run: |
git push -f origin build