Skip to content

Commit

Permalink
Setup Github Actions to build project.
Browse files Browse the repository at this point in the history
  • Loading branch information
bia-pain-bache committed Oct 26, 2024
1 parent f850039 commit 5320ed6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8,981 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
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 }}
Loading

0 comments on commit 5320ed6

Please sign in to comment.