Update and simplify actions (#831)
* Replace action with one we use already * Simplify PR actions * fix name
This commit is contained in:
24
.github/workflows/build-pull-request.yml
vendored
24
.github/workflows/build-pull-request.yml
vendored
@@ -6,6 +6,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build-pull-request:
|
||||
name: 'Build pull request'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PR_NUMBER: ${{github.event.number}}
|
||||
@@ -16,23 +17,22 @@ jobs:
|
||||
uses: actions/setup-node@v3.4.1
|
||||
with:
|
||||
node-version: 17.9.0
|
||||
cache: 'npm'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Build app
|
||||
run: npm ci && npm run build
|
||||
run: npm run build
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3.1.0
|
||||
with:
|
||||
name: previewbuild
|
||||
name: preview
|
||||
path: dist
|
||||
retention-days: 1
|
||||
- name: Get PR info
|
||||
uses: actions/github-script@v6.2.0
|
||||
with:
|
||||
script: |
|
||||
var fs = require('fs');
|
||||
fs.writeFileSync('${{github.workspace}}/pr.json', JSON.stringify(context.payload.pull_request));
|
||||
- name: Upload PR Info
|
||||
- name: Save pr number
|
||||
run: echo ${PR_NUMBER} > ./pr.txt
|
||||
- name: Upload pr number
|
||||
uses: actions/upload-artifact@v3.1.0
|
||||
with:
|
||||
name: pr.json
|
||||
path: pr.json
|
||||
retention-days: 1
|
||||
name: pr
|
||||
path: ./pr.txt
|
||||
retention-days: 1
|
||||
Reference in New Issue
Block a user