Skip to content

fix(angular): fix header version tags #9

fix(angular): fix header version tags

fix(angular): fix header version tags #9

Workflow file for this run

name: Release docs Workflow
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: 'Build Docusaurus Documentation'
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
steps:
- name: 'Checkout repository'
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Install dependencies and build'
run: |
cd documentation
npm install
npm run build
- name: 'Fetch branches'
run: git fetch origin
- name: 'Set Git user name and email'
run: |
git config --local user.email "github-actions@github.com"
git config --local user.name "GitHub Actions"
- name: 'Copy Docusaurus build artifacts to gh-pages branch'
run: |
# Create a temp directory to store the build files
mkdir -p /tmp/temp-directory
# Enable dotglob to copy hidden files (like .gitignore)
shopt -s dotglob
# Copy the build from the docs-docusaurus/build folder
cp -r documentation/build/* /tmp/temp-directory/
shopt -u dotglob
# Stash any changes to prevent checkout conflicts
git stash push
# Switch to the gh-pages branch, creating it if it doesn't exist
git checkout gh-pages || git checkout -b gh-pages
# Remove all files from the gh-pages branch
rm -rf *
# Copy the build artifacts from the temp directory
cp -r /tmp/temp-directory/* .
# Check if there are any changes before committing
if [[ -n "$(git status --porcelain)" ]]; then
git add . -f
git commit -m "chore(docs): copy docusaurus build artifacts to gh-pages branch"
else
echo "No changes to commit"
fi
- name: Push to gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin gh-pages --force || echo "No changes to push"
- name: 'Switch back to main branch'
run: |
git checkout main
git stash pop || true # Restore stashed changes if any