Skip to content

Commit

Permalink
Add GItHub workflows for automatic compilation and build push
Browse files Browse the repository at this point in the history
  • Loading branch information
CrafterKolyan committed Dec 4, 2024
1 parent c733804 commit 4e8f7da
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Autobuild Javascript module"

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build_js:
name: "Build main Javascript module"
runs-on: ubuntu-latest

steps:
- name: Checkout to workspace
uses: actions/checkout@v4

- name: Print all environment variables
run: printenv

- name: Install esbuild
run: |
npm install esbuild
- name: Build main Javascript module
run: |
npx esbuild src/main.ts --outfile=js/main.js --bundle
- name: Commit changed files
if: always()
run: |
git config --global user.name "Github Action"
git config --global user.email "action@github.com"
git add js/main.js && \
(git commit -m "[Github Action] Update js/main.js" || true) && \
git checkout . && \
git pull origin ${GITHUB_REF##*/} --rebase --strategy-option=ours
- name: Push changes
uses: ad-m/github-push-action@v0.8.0
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/compile-typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Compile Typescript"

on:
push:
branches:
- main
workflow_dispatch:

jobs:
compile-typescript:
name: "Compile Typescript"
runs-on: ubuntu-latest

steps:
- name: Checkout to workspace
uses: actions/checkout@v4

- name: Install tsc
run: |
npm install typescript
- name: Compile Typescript
run: |
npx tsc

0 comments on commit 4e8f7da

Please sign in to comment.