-
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.
Add GItHub workflows for automatic compilation and build push
- Loading branch information
1 parent
c733804
commit 4e8f7da
Showing
2 changed files
with
67 additions
and
0 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,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 }} |
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,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 |