File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,29 +3,43 @@ name: Deploy MkDocs
33on :
44 push :
55 branches :
6- - main
6+ - main # Solo se ejecuta cuando hay cambios en main
7+
8+ permissions :
9+ contents : write # Permite a Actions hacer push a gh-pages
710
811jobs :
912 deploy :
1013 runs-on : ubuntu-latest
1114
1215 steps :
13- - name : Checkout repo
16+ - name : Checkout repository
1417 uses : actions/checkout@v4
1518 with :
1619 fetch-depth : 0
1720
21+ - name : Setup Python
22+ uses : actions/setup-python@v4
23+ with :
24+ python-version : ' 3.12'
25+
1826 - name : Install dependencies
19- run : pip install mkdocs-material
27+ run : |
28+ pip install mkdocs mkdocs-material
2029
2130 - name : Configure Git
31+ env :
32+ GH_PAT : ${{ secrets.GH_PAT }}
2233 run : |
2334 git config --global user.name "github-actions"
2435 git config --global user.email "github-actions@github.com"
36+ git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/jgimillo/corec.git
37+ git fetch --unshallow || true # Evita errores en repositorios shallow
38+ git checkout gh-pages || git checkout --orphan gh-pages
39+ git reset --hard
2540
2641 - name : Deploy to GitHub Pages
2742 env :
28- GH_TOKEN : ${{ secrets.GH_PAT }}
43+ GH_PAT : ${{ secrets.GH_PAT }}
2944 run : |
30- git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/jgimillo/corec.git
3145 mkdocs gh-deploy --force --remote-branch gh-pages --remote-name origin --config-file docs/mkdocs.yml
You can’t perform that action at this time.
0 commit comments