-
Notifications
You must be signed in to change notification settings - Fork 232
45 lines (41 loc) · 1.2 KB
/
shadow-repo-build.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
name: Shadow Repo
on:
push:
pull_request:
types: [opened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run build-prod
- run: tar cf site.tar _site
- uses: actions/upload-artifact@v3
with:
name: site
path: site.tar
prep-diff-link:
name: Prep comment
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'opened'
steps:
- name: Save comment
env:
COMMENT: |
View diff of compiled files (may take a few minutes): https://github.com/${{ vars.SHADOW_OWNER }}/${{ vars.SHADOW_REPO }}/compare/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.ref }}
run: |
echo $COMMENT > ./comment.txt
- uses: actions/upload-artifact@v3
with:
name: comment
path: comment.txt