Skip to content

Commit

Permalink
Merge pull request #323 from purrbot-site/feature/switch-to-gh-action…
Browse files Browse the repository at this point in the history
…-publish

Use GitHub Actions-based page deployment
  • Loading branch information
Andre601 authored Nov 3, 2023
2 parents aedf6f5 + 22fd3a8 commit de3e110
Showing 1 changed file with 22 additions and 44 deletions.
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.outputs.page_url }}
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/discord-commits@v1.6
- 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

0 comments on commit de3e110

Please sign in to comment.