Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorg doc deploy step for new GITHUB_TOKEN permissions requirements #659

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 43 additions & 8 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ jobs:
# Make sure we can publish the coverage report.
rm -f doc/build/html/htmlcov/.gitignore

- uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/main'
with:
name: docs
path: doc/build/html

- name: Publish package to Test PyPi
if: github.event_name == 'release' && github.ref_type == 'tag'
run: |
Expand All @@ -194,14 +200,6 @@ jobs:
mlos-devcontainer make CONDA_INFO_LEVEL=-v publish-pypi
fi

- name: Deploy to GitHub pages
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: doc/build/html
clean: true

- name: Cleanup the devcontainer
run: |
set -x
Expand Down Expand Up @@ -241,3 +239,40 @@ jobs:
docker push ${{ secrets.ACR_LOGINURL }}/devcontainer-cli:$image_tag
docker tag mlos-devcontainer:latest ${{ secrets.ACR_LOGINURL }}/mlos-devcontainer:$image_tag
docker push ${{ secrets.ACR_LOGINURL }}/mlos-devcontainer:$image_tag

DeployDocs:
if: github.ref == 'refs/heads/main'
needs: DevContainer
runs-on: ubuntu-latest

# Required for github-pages-deploy-action to push to the gh-pages branch.
permissions:
contents: write
bpkroth marked this conversation as resolved.
Show resolved Hide resolved

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: docs
path: doc/build/html

- name: Check docs
run: |
set -x
# Check that the docs are not empty.
if [ ! -d doc/build/html ]; then
echo "ERROR: No docs found in doc/build/html" >&2
exit 1
fi
if [ ! -f doc/build/html/index.html ]; then
echo "ERROR: No index.html found in doc/build/html" >&2
exit 1
fi

- name: Deploy to GitHub pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: doc/build/html
clean: true
Loading