refactor: rename getting started file to index #11
This file contains hidden or 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
| name: Deploy Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'mkdocs.yml' | |
| - 'pyproject.toml' | |
| - '.github/workflows/docs.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: latest | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Load cached dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: .venv | |
| key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
| - name: Install dependencies | |
| run: poetry install --no-interaction --no-root | |
| - name: Build documentation | |
| run: poetry run mkdocs build | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./site | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: Send Discord notification | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| run: | | |
| # Check if webhook URL is set | |
| if [ -z "$DISCORD_WEBHOOK_URL" ]; then | |
| echo "Discord webhook URL not set, skipping notification" | |
| exit 0 | |
| fi | |
| # Get commit info | |
| COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s") | |
| COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an") | |
| COMMIT_SHA=$(git log -1 --pretty=format:"%h") | |
| COMMIT_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}" | |
| # Create Discord notification | |
| cat << EOF > discord_payload.json | |
| { | |
| "embeds": [ | |
| { | |
| "title": "π Documentation Deployed", | |
| "description": "The Beet documentation has been successfully updated and deployed!", | |
| "color": 3447003, | |
| "url": "https://alter-dimensions.github.io/beetween", | |
| "fields": [ | |
| { | |
| "name": "π Latest Commit", | |
| "value": "**$COMMIT_MESSAGE**\nby $COMMIT_AUTHOR (\`$COMMIT_SHA\`)", | |
| "inline": false | |
| }, | |
| { | |
| "name": "π Links", | |
| "value": "[π View Documentation](https://alter-dimensions.github.io/beetween) β’ [π» View Commit]($COMMIT_URL)", | |
| "inline": false | |
| } | |
| ], | |
| "footer": { | |
| "text": "Beetween Documentation β’ Pre-commit validated" | |
| }, | |
| "timestamp": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" | |
| } | |
| ] | |
| } | |
| EOF | |
| # Send notification | |
| curl -H "Content-Type: application/json" -d @discord_payload.json "$DISCORD_WEBHOOK_URL" |