{Automation} Add CI tests (#136) #55
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
on: | |
push: | |
branches: | |
- master | |
name: build-release | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: build-release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- run: sudo npm i -g @vercel/ncc | |
- run: npm install | |
- name: Compile files | |
run: | | |
ncc build -C -m src/entrypoint.ts | |
- name: Commit Files | |
continue-on-error: true # commit will fail if the code wasn't changed. Prevent the build to fail in this case. | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add dist/index.js -f | |
git commit -m "Add changes" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: master |