forked from fermyon/developer
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 913 Bytes
/
Copy pathdeploy-preview.yml
File metadata and controls
34 lines (29 loc) · 913 Bytes
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
name: deploy docs preview
on:
pull_request:
branches: "main"
types: ['opened', 'synchronize', 'reopened', 'closed']
jobs:
deploy-preview:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork }}
name: Build and deploy
steps:
- uses: actions/checkout@v3
- name: Setup `spin`
uses: fermyon/actions/spin/setup@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install npm packages
run: |
npm ci
npm ci --prefix ./spin-up-hub
- name: Build app
run: |
spin build
- name: build and deploy preview
uses: fermyon/actions/spin/preview@v1
with:
fermyon_token: ${{ secrets.FERMYON_CLOUD_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
undeploy: ${{ github.event.pull_request && github.event.action == 'closed' }}