-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Version website with mike * Fix build with latest mkdocs * Fix blog link with mike
- Loading branch information
1 parent
eec20b0
commit cf9e9d0
Showing
5 changed files
with
24 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ on: | |
pull_request: | ||
branches-ignore: | ||
- 'gh-pages' | ||
schedule: | ||
- cron: '0 * * * *' | ||
jobs: | ||
build: | ||
name: Build | ||
|
@@ -24,44 +22,18 @@ jobs: | |
architecture: x64 | ||
- name: Install requirements.txt | ||
run: pip install -r requirements.txt | ||
- name: Build | ||
run: mkdocs build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: site | ||
path: site/* | ||
if-no-files-found: error | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: gh-pages | ||
path: dist | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: site | ||
path: artifacts | ||
- name: Deploy | ||
- name: Setup git | ||
run: | | ||
set -euo pipefail | ||
rsync -az --exclude=.git --delete ./artifacts/ ./dist/ | ||
cd dist | ||
git config user.name "ContainerSSH Build Agent" | ||
git config user.email [email protected] | ||
git add . | ||
if ! git diff-index --quiet HEAD --; then | ||
git commit -m "Website publish" | ||
git push --set-upstream --force origin gh-pages | ||
fi | ||
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" | ||
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | ||
git fetch origin gh-pages | ||
- name: Deploy upcoming | ||
run: mike deploy upcoming --push | ||
if: github.ref == 'refs/heads/main' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Deploy version | ||
run: mike deploy "$GITHUB_REF_NAME" --push | ||
if: startsWith(github.ref, 'refs/heads/v') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ PyGithub~=1.54 | |
pyyaml>=5.3.1 | ||
requests | ||
mkdocs-rss-plugin | ||
mike |