-
Notifications
You must be signed in to change notification settings - Fork 30.5k
40 lines (32 loc) · 1.08 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
name: Build and Deploy Worker
on:
push:
branches:
- dev
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "latest"
- name: Install dependencies
run: npm install
- name: Build project
run: |
npx wrangler deploy src/worker.js --name bpb-worker-panel --compatibility-flag [nodejs_compat] --compatibility-date 2024-10-26 --dry-run --outdir=dist
npx javascript-obfuscator --split-strings true --split-strings-chunk-length 2 dist/worker.js --output _worker.js
- name: Commit and push built worker
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add _worker.js
git commit -m "Automated build: update _worker.js"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}