2022-03-15 20:34:14 +09:00
|
|
|
name: 'Build pull request'
|
2021-11-14 16:24:17 +09:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: ['opened', 'synchronize']
|
|
|
|
|
|
|
|
jobs:
|
2022-03-15 20:34:14 +09:00
|
|
|
build-pull-request:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{github.event.number}}
|
|
|
|
steps:
|
2022-03-23 23:10:39 +09:00
|
|
|
- name: Checkout repository
|
2022-04-26 20:53:22 +09:00
|
|
|
uses: actions/checkout@v3.0.2
|
2022-06-14 23:25:48 +09:00
|
|
|
- name: Setup node
|
2022-07-16 20:41:48 +09:00
|
|
|
uses: actions/setup-node@v3.4.1
|
2022-06-14 23:25:48 +09:00
|
|
|
with:
|
|
|
|
node-version: 17.9.0
|
2022-03-15 20:34:14 +09:00
|
|
|
- name: Build app
|
|
|
|
run: npm ci && npm run build
|
|
|
|
- name: Upload artifact
|
2022-05-24 23:10:24 +09:00
|
|
|
uses: actions/upload-artifact@v3.1.0
|
2022-03-15 20:34:14 +09:00
|
|
|
with:
|
|
|
|
name: previewbuild
|
|
|
|
path: dist
|
|
|
|
retention-days: 1
|
|
|
|
- name: Get PR info
|
2022-09-02 22:45:03 +09:00
|
|
|
uses: actions/github-script@v6.2.0
|
2022-03-15 20:34:14 +09:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
var fs = require('fs');
|
|
|
|
fs.writeFileSync('${{github.workspace}}/pr.json', JSON.stringify(context.payload.pull_request));
|
|
|
|
- name: Upload PR Info
|
2022-05-24 23:10:24 +09:00
|
|
|
uses: actions/upload-artifact@v3.1.0
|
2022-03-15 20:34:14 +09:00
|
|
|
with:
|
|
|
|
name: pr.json
|
|
|
|
path: pr.json
|
|
|
|
retention-days: 1
|