-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (33 loc) · 1.23 KB
/
preview.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
name: Deploy Preview
on:
workflow_dispatch:
jobs:
preview:
runs-on: ubicloud-standard-2
timeout-minutes: 120
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
cache: "npm"
- run: npm ci
- name: Cache ngrok binary
id: cache-ngrok
uses: ubicloud/cache@v4
with:
path: /usr/local/bin/ngrok
key: ngrok-binary
- name: Install ngrok
if: steps.cache-ngrok.outputs.cache-hit != 'true'
run: curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok
- name: Set ngrok token
run: ngrok config add-authtoken ${{ secrets.NGROK_TOKEN }}
- name: Local to public
run: ngrok http http://localhost:3000 --log ngrok.log > /dev/null &
- name: Preview URL
run: cat ngrok.log | grep "started tunnel" | sed 's/.*url=\(.*\)/\1/'
- name: Run Mintlify
run: npx mintlify dev --no-open