forked from Kong/konnect-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 2.18 KB
/
github-pages.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
name: Deploy on Kong github-pages
# This is a workflow to deploy konnect-portal using github pages
# This one will build the UI to use the api located https://api-konnect-portal.konghq.com
# And will be resolved by the CNAME konnect-portal.konghq.com
# If you want to implement this please see the following workflow and its explanations
on:
workflow_dispatch:
push:
branches:
- main
jobs:
deploy:
# This permission is required on the first run of running the action on a branch
# because the branch doesn't exist the workflow needs permission to create it
permissions:
contents: write
if: github.repository == 'kong/konnect-portal'
name: deploy build to github-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: node modules cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ hashFiles('.nvmrc', 'yarn.lock') }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: generate env file
# generating the environment file to have our final build
# This is likely to be adjustred for your needs
run: |
echo "VITE_PORTAL_API_URL='https://api-konnect-portal.konghq.com/'" >> .env
echo "VITE_LOCALE='en'" >> .env
echo "VITE_ENABLE_LAUNCH_DARKLY=true" >> .env
- name: Lint
run: yarn lint
- name: Build
run: yarn build
# See documentation of the github action below
# ref: https://github.com/peaceiris/actions-gh-pages/tree/v3
- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated github token
publish_branch: gh-pages # the branch where you want the dist to be published
publish_dir: ./dist # this is the output directory of `yarn build` command
cname: konnect-portal.konghq.com # the cname to be resolved for the UI
force_orphan: true # this will clean the commit history of the `gh-pages` branch