39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: Build with ncc
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: RouxAntoine/checkout@v3.5.4
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
- name: Install npm and package
|
|
run: |
|
|
# Get github branch without refs
|
|
GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' )
|
|
echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> "$GITHUB_ENV"
|
|
|
|
# Install npm, ncc and build
|
|
npm install
|
|
# npm i -g @vercel/ncc
|
|
npm run build
|
|
- id: check-for-changes
|
|
uses: sigyl-actions/check-for-changes@v1.0.1
|
|
- name: commit and push
|
|
run: |
|
|
if [ ${{ steps.check-for-changes.outputs.changes }} = true ]; then
|
|
git config user.name "${{ github.actor }}"
|
|
git config user.email "${{ github.event.pusher.email }}"
|
|
git add -A
|
|
git commit -m "Update ncc build to latest version"
|
|
git push origin HEAD
|
|
else
|
|
echo no changes
|
|
fi
|
|
|