forked from github-developer/upload-azure-blob
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (35 loc) · 968 Bytes
/
ci.yml
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
36
37
38
39
40
41
42
43
44
45
46
# Continuous Integration workflow to:
# 1. Build, lint, and test project
# 2. Commit any updates to "dist" folder
on:
push:
branches:
- main
pull_request:
name: Continuous Integration
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12'
- run: npm install
- run: npm run build
- run: npm run lint
- run: npm run test
- name: Examine changes
run: |-
echo 'FILES_CHANGED<<EOF' >> $GITHUB_ENV
git diff --exit-code dist/index.js >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Update dist
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && env.FILES_CHANGED }}
uses: swinton/commit@v2.x
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files:
dist/index.js
commit-message: Update dist