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

Use GitHub Actions-based page deployment #323

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Changes from 1 commit
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
66 changes: 22 additions & 44 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,21 @@ on:
branches:
- master

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.output.page_url }}
Andre601 marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Chekout code
uses: actions/checkout@v4
Expand All @@ -25,48 +37,14 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
- name: Deploy Files
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote add gh-token "https://github.com/purrbot-site/Docs.git"
git fetch gh-token && git fetch gh-token gh-pages:gh-pages
python -m mkdocs gh-deploy --clean -m "Deploying Docs to GitHub Pages (${GITHUB_SHA:0:7})" --remote-name gh-token
git push gh-token gh-pages
sendMsg:
needs: [build]
if: success()
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Send Discord Notification
uses: Sniddl/[email protected]
- name: Build documentation
run: mkdocs build
- name: Configure GitHub Pages
uses: actions/configure-pages@v3
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
embed: |
{
"color": 65280,
"title": "Documentation updated!",
"url": "https://github.com/purrbot-site/Docs",
"footer": {
"text": "Page built using MkDocs"
},
"fields": [
{
"name": "Commit",
"value": "[`${{ github.event.after }}`](${{ github.event.compare }})",
"inline": false
},
{
"name": "Source",
"value": "https://github.com/purrbot-site/Docs",
"inline": false
},
{
"name": "Site",
"value": "https://docs.purrbot.site",
"inline": false
}
]
}
path: 'site/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2