Skip to content

Commit

Permalink
Add publish workflow to Github Actions
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
David Davis committed Nov 20, 2020
1 parent aed6911 commit 8ca31db
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 24 deletions.
20 changes: 0 additions & 20 deletions templates/github/.ci/scripts/publish_docs.sh.j2

This file was deleted.

8 changes: 4 additions & 4 deletions templates/github/.github/workflows/release.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ jobs:
{%- endif %}

{%- if publish_docs_to_pulpprojectdotorg %}
- name: Publish docs to pulpproject.org
run: bash .ci/scripts/publish_docs.sh tag $BRANCH
env:
- BRANCH=${GITHUB_REF##*/}
- name: Publish Docs
env:
PULP_DOCS_KEY: {% raw %}${{ secrets.PULP_DOCS_KEY }}{% endraw %}
run: .github/workflows/scripts/publish_docs.sh
{%- endif %}

{%- if update_redmine %}
Expand Down
32 changes: 32 additions & 0 deletions templates/github/.github/workflows/scripts/publish_docs.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

{% include 'header.j2' %}

set -euv

export WORKSPACE=$GITHUB_WORKSPACE
export BRANCH="${GITHUB_REF##*/}"

mkdir ~/.ssh
echo "$PULP_DOCS_KEY" > ~/.ssh/pulp-infra
chmod 600 ~/.ssh/pulp-infra

echo "docs.pulpproject.org,8.43.85.236 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGXG+8vjSQvnAkq33i0XWgpSrbco3rRqNZr0SfVeiqFI7RN/VznwXMioDDhc+hQtgVhd6TYBOrV07IMcKj+FAzg=" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts

pip3 install -r doc_requirements.txt

export PYTHONUNBUFFERED=1
export DJANGO_SETTINGS_MODULE=pulpcore.app.settings
export PULP_SETTINGS=$WORKSPACE/.github/settings/settings.py

eval "$(ssh-agent -s)" #start the ssh agent
ssh-add ~/.ssh/pulp-infra

if [[ $GITHUB_REF = "refs/heads"* ]]; then
type="nightly"
else
type="tag"
fi

python3 $WORKSPACE/.ci/scripts/docs-builder.py --build-type $type --branch $BRANCH

0 comments on commit 8ca31db

Please sign in to comment.