Skip to content

Commit

Permalink
Fix docs workflow
Browse files Browse the repository at this point in the history
Python version 3.11 seems to be required.

[noissue]
  • Loading branch information
mdellweg committed Aug 1, 2024
1 parent d8ff2c5 commit 9e39ba3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
---
name: Publish staging-docs.pulpproject.org
name: "Publish pulpproject.org"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# runs at 3:00 UTC daily on weekdays 1 to 5 (no weekends)
- cron: '00 3 * * 1-5'
- cron: "00 3 * * 1-5"
workflow_dispatch:

defaults:
run:
working-directory: "pulpcore"

jobs:
build-staging-docs:
build-docs:
runs-on: "ubuntu-latest"

steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
path: "pulpcore"
- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.9"
- name: "Build HTML site for staging-docs.pulpproject.org."
python-version: "3.11"
- name: "Build HTML site for pulpproject.org."
run: |
.github/workflows/scripts/build_all_docs.sh
- name: "Upload documentation site"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "staging-docs.pulpproject.org.tar"
path: "pulpcore/staging-docs.pulpproject.org.tar"
name: "docs.pulpproject.org.tar"
path: "pulpcore/pulpproject.org.tar"
if-no-files-found: "error"

publish-staging-docs:
publish-docs:
runs-on: "ubuntu-latest"
needs:
- "build-staging-docs"
- "build-docs"

env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Expand All @@ -47,9 +45,9 @@ jobs:
fetch-depth: 1
path: "pulpcore"

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.9"
python-version: "3.11"

- name: "Setting secrets"
run: |
Expand All @@ -58,11 +56,12 @@ jobs:
SECRETS_CONTEXT: "${{ toJson(secrets) }}"

- name: "Download built docs"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
name: "staging-docs.pulpproject.org.tar"
name: "pulpproject.org.tar"
path: "pulpcore/"

- name: "Publish docs to staging-docs.pulpproject.org"
- name: "Publish docs to pulpproject.org"
run: |
.github/workflows/scripts/publish-staging-docs.sh
.github/workflows/scripts/publish_all_docs.sh
...
8 changes: 6 additions & 2 deletions .github/workflows/scripts/build_all_docs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This script builds the documentation site for staging-docs.pulpproject.org
#!/bin/bash

# This script builds the documentation site for pulpproject.org

set -euv

pip install git+https://github.com/pulp/pulp-docs.git
pulp-docs build
tar cvf staging-docs.pulpproject.org.tar site
tar cvf pulpproject.org.tar site
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -euv

# make sure this script runs at the repo root
Expand All @@ -20,9 +22,9 @@ export WORKSPACE=$PWD
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/pulp-infra

mkdir -p ../staging-docs.pulpproject.org
tar -xvf staging-docs.pulpproject.org.tar --directory ../staging-docs.pulpproject.org
pushd ../staging-docs.pulpproject.org
mkdir -p ../pulpproject.org
tar -xvf pulpproject.org.tar --directory ../pulpproject.org
pushd ../pulpproject.org

# publish to pulpproject.org
rsync -avzh --delete site/ [email protected]:/var/www/docs.pulpproject.org/staging_pulp_core/
Expand Down

0 comments on commit 9e39ba3

Please sign in to comment.