added contents write permissions to GIT_TOKEN #4
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
name: Deploy MkDocs to GitHub Pages | |
on: | |
push: | |
branches: | |
- master # Trigger workflow only on pushes to the main branch | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository code | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Set up Python environment | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
# Install dependencies (MkDocs and Material theme) | |
- name: Install dependencies | |
run: | | |
pip install mkdocs-material | |
# Build and deploy the site to GitHub Pages | |
- name: Deploy to GitHub Pages | |
run: | | |
# sed -i -E "s/your-username/${{github.repository_owner}}/g" ./README.md | |
# sed -i -E "s/my-mkdocs-project/${{github.repository}}/g" ./README.md | |
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/ADORSYS-GIS/mk-docs.git | |
mkdocs gh-deploy --force |