forked from axel-op/googlejavaformat-action
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 972 Bytes
/
compile.yml
File metadata and controls
35 lines (33 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Compile and push dist file
on: [push, pull_request]
jobs:
compile-and-push:
runs-on: ubuntu-latest
steps:
- if: github.event_name != 'pull_request'
uses: actions/checkout@v4
- if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Compile with ncc
run: |
npm install
npx ncc build src/index.ts -o dist
- name: Push
env:
DIR: dist
run: |
if git diff --exit-code $DIR
then
exit 0
fi
git config user.name github-actions
git config user.email github-actions@github.com
git add $DIR/*
git commit -m "Update dist/index.js"
git push