Skip to content
name: build main action
concurrency:
group: build-main-action
on:
push:
branches:
- main
- image-operation
paths:
- js-action/src/**/*
- js-action/package*.json
- js-action/*.js
permissions:
contents: write
env:
AUTHOR_EMAIL: [email protected]
AUTHOR_NAME: 'Github Actions'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@main
with:
node-version: 20
- name: node modules
working-directory: ./js-action
run: npm ci
- name: build
working-directory: ./js-action
run: npm run build
- name: commit builded action
run: |
if git status | grep 'js-action/dist/' -q;
then
git config --global user.email "${AUTHOR_EMAIL}"
git config --global user.name "${AUTHOR_NAME}"
git add ./js-action/dist
git commit -m "builded action"
git push origin ${{ github.ref }}:${{ github.ref }}
fi