From 9e39ba35868e86d0f215a862a71c1326d515a7fc Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Thu, 1 Aug 2024 15:02:45 +0200 Subject: [PATCH] Fix docs workflow Python version 3.11 seems to be required. [noissue] --- .../{staging-docs.yml => all-docs.yml} | 37 +++++++++---------- .github/workflows/scripts/build_all_docs.sh | 8 +++- ...sh-staging-docs.sh => publish_all_docs.sh} | 8 ++-- 3 files changed, 29 insertions(+), 24 deletions(-) rename .github/workflows/{staging-docs.yml => all-docs.yml} (51%) rename .github/workflows/scripts/{publish-staging-docs.sh => publish_all_docs.sh} (83%) diff --git a/.github/workflows/staging-docs.yml b/.github/workflows/all-docs.yml similarity index 51% rename from .github/workflows/staging-docs.yml rename to .github/workflows/all-docs.yml index 42fbe25c5f..fe6e1b3909 100644 --- a/.github/workflows/staging-docs.yml +++ b/.github/workflows/all-docs.yml @@ -1,10 +1,8 @@ --- -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: @@ -12,7 +10,7 @@ defaults: working-directory: "pulpcore" jobs: - build-staging-docs: + build-docs: runs-on: "ubuntu-latest" steps: @@ -20,23 +18,23 @@ jobs: 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 }}" @@ -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: | @@ -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 +... diff --git a/.github/workflows/scripts/build_all_docs.sh b/.github/workflows/scripts/build_all_docs.sh index 040e6213e7..edc332cd1c 100755 --- a/.github/workflows/scripts/build_all_docs.sh +++ b/.github/workflows/scripts/build_all_docs.sh @@ -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 diff --git a/.github/workflows/scripts/publish-staging-docs.sh b/.github/workflows/scripts/publish_all_docs.sh similarity index 83% rename from .github/workflows/scripts/publish-staging-docs.sh rename to .github/workflows/scripts/publish_all_docs.sh index 68aca838b1..4b94189060 100755 --- a/.github/workflows/scripts/publish-staging-docs.sh +++ b/.github/workflows/scripts/publish_all_docs.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -euv # make sure this script runs at the repo root @@ -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/ doc_builder_staging_pulp_core@docs.pulpproject.org:/var/www/docs.pulpproject.org/staging_pulp_core/