-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,15 +25,16 @@ jobs: | |
if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then | ||
RESULT="true" | ||
else | ||
RESULT="true" | ||
RESULT="false" | ||
fi | ||
echo "result=$RESULT" >> $GITHUB_OUTPUT | ||
echo "Deploy documents: $RESULT" | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: pre-publish | ||
if: needs.publish-determination.outputs.result == 'true' | ||
if: needs.pre-publish.outputs.result == 'true' | ||
|
||
steps: | ||
- name: Checkout repository | ||
|
@@ -49,23 +50,37 @@ jobs: | |
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
- name: Create all generated documentation content | ||
run: mkdocs build | ||
|
||
# - name: Create all generated documentation content | ||
# run: mkdocs build | ||
# | ||
- name: Determine versioning parameters | ||
id: determine-versioning | ||
run: echo "data={"version":"5.4.0", "alias"="latest"}" >> $GITHUB_OUTPUT | ||
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: fromJson(steps.determine-versioning.outputs.data).version != null | ||
if: ${{ env.PH_DOCS_VERSION }} != null | ||
run: | | ||
# Publishing implies creating a git commit on the gh-pages branch, we let @ArduinoBot own these commits. | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Phalcon Team Deploy Bot" | ||
# Publishing implies creating a git commit on the production branch, | ||
# we let @phalconbot own these commits. | ||
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 | ||
poetry run mike deploy \ | ||
mike deploy \ | ||
--update-aliases \ | ||
--branch production \ | ||
--push \ | ||
--remote origin \ | ||
${{ fromJson(steps.determine-versioning.outputs.data).version }} \ | ||
${{ fromJson(steps.determine-versioning.outputs.data).alias }} | ||
${{ env.PH_DOCS_VERSION }} \ | ||
${{ env.PH_DOCS_ALIAS }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4.1| |