chore: Change main branch #27
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 | |
| - v1.0 | |
| - v2.0 | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for proper versioning | |
| - name: Configure Git Credentials 🏗 | |
| run: | | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| - name: Fetch gh-pages branch | |
| run: | | |
| git fetch origin gh-pages:gh-pages || true | |
| - name: Deploy v1.0 docs | |
| if: github.ref == 'refs/heads/v1.0' | |
| run: | | |
| mike deploy v1.0 -p --update-aliases --ignore-remote-status --force | |
| - name: Deploy v2.0 docs | |
| if: github.ref == 'refs/heads/v2.0' | |
| run: | | |
| mike deploy v2.0 latest -p --update-aliases --ignore-remote-status --force | |
| mike set-default latest --ignore-remote-status | |
| - name: Deploy from main to v2.0 (latest) | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| mike deploy v2.0 latest -p --update-aliases --ignore-remote-status --force | |
| mike set-default latest --ignore-remote-status | |
| - name: Create CNAME file for GitHub Pages | |
| run: echo "docs.counterapi.dev" > ./site/CNAME | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./site | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |