Skip to content

🚀 Deploy to Github Pages (taiga-ui.dev) #5118

🚀 Deploy to Github Pages (taiga-ui.dev)

🚀 Deploy to Github Pages (taiga-ui.dev) #5118

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: deploy-gh-pages
cancel-in-progress: true