builded action #9
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
name: build | |
concurrency: | |
group: build | |
on: | |
push: | |
branches: | |
- main | |
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 |