forked from machulav/ec2-github-runner
-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (46 loc) · 1.22 KB
/
pr.yml
File metadata and controls
46 lines (46 loc) · 1.22 KB
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
name: PR automations
on:
pull_request:
branches:
- main
jobs:
lint-code:
name: Lint code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ec2-github-runner-${{ hashFiles('**/package-lock.json') }}
- name: Install packages
run: npm install
- name: Run linter
run: npm run lint
package:
name: Package distribution files
runs-on: ubuntu-latest
needs:
- lint-code
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ec2-github-runner-${{ hashFiles('**/package-lock.json') }}
- name: Install packages
run: npm install
- name: Package
run: npm run package
- name: Commit
run: |
git config --global user.name "GitHub Actions"
git add dist/
git commit -m "Update dist" || echo "No changes to commit"
git push origin ${{ github.head_ref }}