-
Notifications
You must be signed in to change notification settings - Fork 36
69 lines (56 loc) · 2.06 KB
/
preview-pr.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
57
58
59
60
61
62
63
64
65
66
67
68
69
### WARNING -- this file was generated by mf
### and stolen from https://github.com/patternfly/patternfly/blob/v5/.github/workflows/pr-preview.yml
name: Deploy PR previews
on:
pull_request_target:
workflow_dispatch:
inputs:
pr_id:
description: PR ID to be deployed to the surge.sh
required: true
default: 0
concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-20.04
env:
DOMAIN: packit-dashboard-pr-${{ github.event.inputs.pr_id || github.event.number }}.surge.sh
GH_PR_NUM: ${{ github.event.inputs.pr_id || github.event.number }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3
# Yes, we really need to get the PR changes
- name: Get the PR changes
run: git fetch origin pull/$GH_PR_NUM/head:tmp
- name: List the PR changes
run: |
git rev-parse origin/main
git rev-parse HEAD
git rev-parse tmp
git log origin/main..tmp --format="%b"
- name: Merge the changes with the ‹main›
run: git merge --no-edit tmp
- name: Check out the script from the ‹main› branch
run: git checkout origin/main .github/notify.py
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"
cache-dependency-path: frontend/yarn.lock
- name: Install and Build
run: |
(cd frontend && yarn install);
make .install-logos
API_URL="https://prod.packit.dev/api" make transpile-prod
- name: Install deploy dependencies
run: yarn global add surge
- name: Deploy the dashboard to surge.sh
run: surge ./frontend/dist $DOMAIN --token ${{ secrets.SURGE_TOKEN }}
env:
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
- name: Install ‹ogr›, cause why not
run: python3 -m pip install ogr
- name: Notify PR about the deployment
run: python3 .github/notify.py $DOMAIN
env:
GH_PR_TOKEN: ${{ secrets.RELEASEBOT_GITHUB_TOKEN }}