Skip to content

Commit

Permalink
Split gh-pages publish to own workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xiwenc committed Sep 8, 2024
1 parent 8826adb commit b4c50c4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish

on:
push:
branches:
- main
- master

jobs:
publish-docs:
name: Release Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY -b gh-pages public
pip install -r requirements.txt
python scripts/generate-policies-docs.py
mkdocs build --verbose --clean
- name: Publish
run: |
git config --global user.name 'Robot'
git config --global user.email '[email protected]'
rsync -av --delete site/ public/
cd public && git add . && git commit -m "Publish" && git push origin gh-pages
19 changes: 0 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,3 @@ jobs:
asset_path: ./policies.tar.gz
asset_name: policies-${{ steps.get_release.outputs.tag_name}}.tar.gz
asset_content_type: application/gzip
release-docs:
name: Release Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY -b gh-pages public
pip install -r requirements.txt
python scripts/generate-policies-docs.py
mkdocs build --verbose --clean
- name: Publish
run: |
git config --global user.name 'Robot'
git config --global user.email '[email protected]'
rsync -av --delete site/ public/
cd public && git add . && git commit -m "Publish" && git push origin gh-pages

0 comments on commit b4c50c4

Please sign in to comment.