2022-03-15 11:34:14 +00:00
|
|
|
name: 'Build pull request'
|
2021-11-14 07:24:17 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: ['opened', 'synchronize']
|
|
|
|
|
|
|
|
jobs:
|
2022-03-15 11:34:14 +00:00
|
|
|
build-pull-request:
|
2022-09-07 08:16:44 +00:00
|
|
|
name: 'Build pull request'
|
2022-03-15 11:34:14 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{github.event.number}}
|
|
|
|
steps:
|
2022-03-23 14:10:39 +00:00
|
|
|
- name: Checkout repository
|
2022-10-11 03:27:58 +00:00
|
|
|
uses: actions/checkout@v3.1.0
|
2022-06-14 14:25:48 +00:00
|
|
|
- name: Setup node
|
2022-10-15 09:43:55 +00:00
|
|
|
uses: actions/setup-node@v3.5.1
|
2022-06-14 14:25:48 +00:00
|
|
|
with:
|
|
|
|
node-version: 17.9.0
|
2022-09-07 08:16:44 +00:00
|
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci
|
2022-03-15 11:34:14 +00:00
|
|
|
- name: Build app
|
2022-09-07 08:16:44 +00:00
|
|
|
run: npm run build
|
2022-03-15 11:34:14 +00:00
|
|
|
- name: Upload artifact
|
2022-10-25 05:15:59 +00:00
|
|
|
uses: actions/upload-artifact@v3.1.1
|
2022-03-15 11:34:14 +00:00
|
|
|
with:
|
2022-09-07 08:16:44 +00:00
|
|
|
name: preview
|
2022-03-15 11:34:14 +00:00
|
|
|
path: dist
|
|
|
|
retention-days: 1
|
2022-09-07 08:16:44 +00:00
|
|
|
- name: Save pr number
|
|
|
|
run: echo ${PR_NUMBER} > ./pr.txt
|
|
|
|
- name: Upload pr number
|
2022-10-25 05:15:59 +00:00
|
|
|
uses: actions/upload-artifact@v3.1.1
|
2022-03-15 11:34:14 +00:00
|
|
|
with:
|
2022-09-07 08:16:44 +00:00
|
|
|
name: pr
|
|
|
|
path: ./pr.txt
|
|
|
|
retention-days: 1
|