forked from kubev2v/forklift-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (32 loc) · 1.02 KB
/
deploy-main-preview.yaml
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
name: Deploy main/release branch preview
on:
push:
branches:
- main
- release*
jobs:
test-and-release:
name: Deploy preview to Surge
if: ${{ github.repository == 'konveyor/forklift-ui' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run ci
- name: Build in mock mode
run: npm run build:mock
- name: Install Surge
run: npm install -g surge
- name: Extract branch name for Surge URL
shell: bash
run: echo "##[set-output name=branch_slug;]$(echo ${GITHUB_REF#refs/heads/}- | tr . _ | sed -r 's/^main-$//g')"
id: extract_branch
- name: Deploy to Surge
run: surge ./dist/ konveyor-forklift-ui-${{ steps.extract_branch.outputs.branch_slug }}preview.surge.sh --token ${{ secrets.SURGE_TOKEN }}