🚀 Deploy to Github Pages (taiga-ui.dev) #4955
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: taiga-family/ci/actions/setup/checkout@v1.74.0 | |
- uses: taiga-family/ci/actions/setup/variables@v1.74.0 | |
- 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/actions-gh-pages@v4.0.0 | |
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 |