Skip to content

Commit

Permalink
Create build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
am2222 authored Mar 2, 2024
1 parent 6899772 commit 1c08323
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
- uses: actions/setup-node@v3
with:
node-version: 20.x
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
cache: 'npm'
- uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Create local changes
run: |
npm ci
npm test
npm run tsc --if-present
npm run publish:patch
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "Build"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

0 comments on commit 1c08323

Please sign in to comment.