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