Add missing label for the custom HelmRepository #1
Workflow file for this run
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: Release Docs | |
on: | |
push: | |
tags: | |
- 'v*' # Triggers on any tag push or force-push | |
workflow_dispatch: # Allows manual trigger | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Configure Git Credentials | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Cache Dependencies | |
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- name: Restore Cached Dependencies | |
uses: actions/cache@v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- name: Install mkdocs-material and mike | |
run: | | |
python -m pip install --upgrade pip | |
pip install --disable-pip-version-check -r requirements.txt | |
- name: Extract version from tag | |
run: | | |
TAG_NAME=$(git tag --list "v*" --sort=-version:refname | head -n 1) | |
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV | |
echo "Extracted TAG_NAME: ${TAG_NAME}" | |
- name: Deploy Docs | |
run: | | |
git fetch origin gh-pages | |
git checkout gh-pages | |
git pull origin gh-pages --rebase | |
git checkout "$TAG_NAME" | |
mike deploy "$TAG_NAME" --push | |
mike set-default "$TAG_NAME" --push | |
- name: Create or Update Tag-Based Branch | |
run: | | |
# Define the branch name from the tag | |
BRANCH_NAME="release-${TAG_NAME}" | |
# Check if the branch exists | |
if git ls-remote --heads origin "$BRANCH_NAME" | grep "$BRANCH_NAME"; then | |
echo "Branch $BRANCH_NAME exists, updating..." | |
git checkout "$BRANCH_NAME" | |
git reset --hard "$TAG_NAME" | |
else | |
echo "Branch $BRANCH_NAME does not exist, creating..." | |
git checkout -b "$BRANCH_NAME" "$TAG_NAME" | |
fi | |
# Push the branch forcefully to match the latest tag | |
git push origin "$BRANCH_NAME" --force |