forked from benminer/cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.04 KB
/
pr-chat.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Pull request (cloud-chat)
on:
pull_request:
paths:
- ".github/workflows/pr-chat.yml"
- "examples/cloud-chat/**"
- "!**.md"
jobs:
test:
name: Test and preview
runs-on: [ubuntu-20.04]
env:
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}
PREVIEW_INSTANCE_NAME: pr-${{ github.event.number }}
defaults:
run:
working-directory: examples/cloud-chat
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: v16
- run: npm install
- run: npm test
- id: deploy
run: echo "::set-output name=preview_url::$(npm run preview:deploy | grep https)"
- uses: actions/github-script@v5
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Deployed preview instance ${{ steps.deploy.outputs.preview_url }}'
})