forked from bia-pain-bache/BPB-Worker-Panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup Github Actions to build project.
- Loading branch information
1 parent
f850039
commit 5320ed6
Showing
2 changed files
with
40 additions
and
8,981 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Build and Deploy Worker | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@latest | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@latest | ||
with: | ||
node-version: "latest" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Install Wrangler | ||
run: npm install -g wrangler | ||
|
||
- name: Build project | ||
run: | | ||
npx wrangler deploy --dry-run --outdir=dist | ||
cp ./dist/worker.js ./_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 }} |
Oops, something went wrong.