Update and simplify actions (#831)

* Replace action with one we use already

* Simplify PR actions

* fix name
This commit is contained in:
Krishan 2022-09-07 13:46:44 +05:30 committed by GitHub
parent b8a8babc88
commit 831bb83f4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 102 deletions

View file

@ -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