forked from giranm/pd-live-react
-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (72 loc) · 2.56 KB
/
cd-workflow.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
70
71
72
73
74
75
76
77
78
name: PagerDuty Live Continuous Deployment Pipeline (Main)
on:
# Runs on pushes targeting the default branch
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-deploy:
runs-on: ubuntu-latest
env:
CI: false
VITE_PD_ENV: ${{ secrets.PD_ENV }}
VITE_PD_SUBDOMAIN_ALLOW_LIST: '*'
VITE_PD_OAUTH_CLIENT_ID: ${{ secrets.PD_OAUTH_CLIENT_ID }}
VITE_PD_REQUIRED_ABILITY: 'teams'
VITE_DD_APPLICATION_ID: ${{ secrets.DD_APPLICATION_ID }}
VITE_DD_CLIENT_TOKEN: ${{ secrets.DD_CLIENT_TOKEN }}
VITE_DD_SITE: ${{ secrets.DD_SITE }}
VITE_DD_SAMPLE_RATE: ${{ secrets.DD_SAMPLE_RATE }}
VITE_DD_TRACK_INTERACTIONS: ${{ secrets.DD_TRACK_INTERACTIONS }}
VITE_DD_DEFAULT_PRIVACY_LEVEL: ${{ secrets.DD_DEFAULT_PRIVACY_LEVEL }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- name: Install Yarn
run: npm install -g yarn
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install project dependencies (via cache)
run: yarn --frozen-lockfile --prefer-offline --ignore-optional
- name: Build application bundle
run: yarn build
- name: Deploy
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
sync-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Merge main -> develop
uses: devmasx/merge-branch@master
with:
type: now
from_branch: main
target_branch: develop
github_token: ${{ secrets.GITHUB_TOKEN }}