correcting color link (#238) #484
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
# Workflow inspiration and adaptation came from Andruino-Cli | |
# https://github.com/arduino/arduino-cli/blob/master/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml | |
name: Deploy Documents 5.7 | |
env: | |
PYTHON_VERSION: "3.9" | |
on: | |
push: | |
branches: | |
# Branch to base "dev" website on. Set in siteversion.py also. | |
- master | |
# Release branches have names like 0.8.x, 0.9.x, ... | |
- "[0-9]+.[0-9]+.x" | |
create: | |
jobs: | |
pre-publish: | |
runs-on: ubuntu-latest | |
outputs: | |
result: ${{ steps.determination.outputs.result }} | |
steps: | |
- name: Determine if documentation should be published on this workflow run | |
id: determination | |
run: | | |
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" | |
if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then | |
RESULT="true" | |
else | |
RESULT="false" | |
fi | |
echo "result=$RESULT" >> $GITHUB_OUTPUT | |
echo "Deploy documents: $RESULT" | |
publish: | |
runs-on: ubuntu-latest | |
needs: pre-publish | |
if: needs.pre-publish.outputs.result == 'true' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Requirements | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
- name: Get sponsors and fanart | |
run: | | |
wget -O docs/assets/sponsors.md \ | |
https://raw.githubusercontent.com/phalcon/assets/master/phalcon/sponsors-fragment.html | |
wget -O overrides/fanart.md \ | |
https://raw.githubusercontent.com/phalcon/assets/master/phalcon/fanart-fragment.html | |
- name: Determine versioning parameters | |
id: determine-versioning | |
run: | | |
# Read the first line from the VERSION file | |
LINE=$(head -n 1 ./VERSION) | |
# Extract version and alias using parameter expansion | |
VERSION="${LINE%%|*}" | |
ALIAS="${LINE#*|}" | |
# Print the extracted values for verification | |
echo "Version: $VERSION" | |
echo "Alias: $ALIAS" | |
echo "PH_DOCS_VERSION=$VERSION" >> $GITHUB_ENV | |
echo "PH_DOCS_ALIAS=$ALIAS" >> $GITHUB_ENV | |
- name: Deploy | |
if: ${{ env.PH_DOCS_VERSION }} != null | |
run: | | |
# Publishing implies creating a git commit on the production branch, | |
# We will need to create a user for this at some point | |
git config user.name niden | |
git config user.email [email protected] | |
git fetch --no-tags --prune --depth=1 origin +refs/heads/production:refs/remotes/origin/production | |
mike deploy \ | |
--update-aliases \ | |
--branch production \ | |
--push \ | |
${{ env.PH_DOCS_VERSION }} \ | |
${{ env.PH_DOCS_ALIAS }} |