-
Notifications
You must be signed in to change notification settings - Fork 472
69 lines (60 loc) · 2.26 KB
/
deploy-gh-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
57
58
59
60
61
62
63
64
65
66
67
68
69
name: 🚀 Deploy to Github Pages (taiga-ui.dev)
on:
workflow_run:
workflows: ['🚀 Snapshots']
types:
- completed
workflow_dispatch:
inputs:
dryRun:
type: boolean
required: false
description: --dry-run
jobs:
deploy-gh-pages:
if: ${{ !contains(github.event.workflow_run.head_branch, 'release/') }}
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- name: Prepare demo before deploy from snapshots
run: |
git clone --depth 1 --branch snapshots/demo/v4.x ${{ env.REPO }} ${{ env.DIST }}
git clone --depth 1 --branch snapshots/demo/v3.x ${{ env.REPO }} ${{ env.DIST }}/v3
git clone --depth 1 --branch snapshots/demo/v2.x ${{ env.REPO }} ${{ env.DIST }}/v2
git clone --depth 1 --branch snapshots/demo/next/main ${{ env.REPO }} ${{ env.DIST }}/next
- name: Cleanup after clone snapshots
run: find ${{ env.DIST }} -name ".git" -exec rm -rf {} \; > /dev/null 2>&1 || echo "removed .git"
- name: Replace baseHref for next
uses: jacobtomlinson/gha-find-replace@v3
with:
find: '<base href="/">'
replace: '<base href="/next/">'
include: '${{ env.DIST }}/next/**/index.html'
regex: false
- name: Replace baseHref for v2
uses: jacobtomlinson/gha-find-replace@v3
with:
find: '<base href="/">'
replace: '<base href="/v2/">'
include: '${{ env.DIST }}/v2/**/index.html'
regex: false
- name: Replace baseHref for v3
uses: jacobtomlinson/gha-find-replace@v3
with:
find: '<base href="/">'
replace: '<base href="/v3/">'
include: '${{ env.DIST }}/v3/**/index.html'
regex: false
- name: Debug output
run: tree ${{ env.DIST }} -P '*.html'
- name: Deploy to taiga-ui.dev
uses: peaceiris/[email protected]
if: ${{ github.event.inputs.dryRun != 'true' }}
with:
github_token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}
publish_dir: ${{ env.DIST }}
cname: taiga-ui.dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true