-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 1.98 KB
/
npm-publish.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
# issue_comment:
# types: [created, deleted]
# pull_request_review_comment:
# types: [created, deleted]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
# runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- run: npm install
- run: npm run prebuild
- run: echo "::set-output name=action_fruit::strawberry"
- run: echo ::set-env name=PULL_NUMBER::$(echo "$GITHUB_REF" | awk -F / '{print $3}')
shell: bash
- uses: dswistowski/surge-sh-action@v1
with:
token: ${{ secrets.SURGE_TOKEN }}
login: ${{ secrets.SURGE_LOGIN }}
project: ${{ secrets.BUILD_DIRECTORY }}
domain: pr-${{env.PULL_NUMBER}}-sakchyam-naxa.surge.sh
- uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
![deploy](https://user-images.githubusercontent.com/37866666/90683831-e4c78f00-e286-11ea-8611-97fbe86fd7ab.png)Your App is Successfully Deployed to http://pr-${{env.PULL_NUMBER}}-sakchyam-naxa.surge.sh ✔️ @varun2948
# if: contains(github.event.comment.body, '/deploy')
env:
URL: ${{ github.event.issue.comments_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl \
-X POST \
$URL \
-H "Content-Type: application/json" \
-H "Authorization: token $GITHUB_TOKEN" \
--data '{ "body": "Deployed to pr-${{env.PULL_NUMBER}}-sakchyam-naxa.surge.sh" }'