Skip to content

Commit

Permalink
updated workflow for dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
BreakableHoodie committed Nov 30, 2024
1 parent ccec3ed commit 21d53e8
Showing 1 changed file with 11 additions and 39 deletions.
50 changes: 11 additions & 39 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Deploy Documentation

on:
push:
branches:
Expand All @@ -25,48 +26,19 @@ jobs:
python-version: "3.11"
cache: pip

# Step 3: Install required Python dependencies from requirements.txt
# Step 3: Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --cache-dir ~/pip_cache -r requirements.txt
# Step 4: Debug logging to ensure pip cache is created
- name: Check if pip cache exists
run: |
echo "Checking if pip cache directory exists..."
ls -l ~/pip_cache
pip install -r requirements.txt
# Step 5: Cache pip dependencies
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/pip_cache
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# Step 4: Build MkDocs site
- name: Build MkDocs site
run: mkdocs build --strict

# Step 6: Cache MkDocs dependencies after pip cache
- name: Cache MkDocs dependencies
uses: actions/cache@v3
# Step 5: Deploy MkDocs site to GitHub Pages
- name: Deploy MkDocs site to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
path: ~/.cache
key: ${{ runner.os }}-mkdocs-v1-${{ hashFiles('mkdocs.yml') }}
restore-keys: |
${{ runner.os }}-mkdocs-v1-
# Step 7: Validate MkDocs configuration
- name: Validate MkDocs configuration
run: mkdocs build --config-file mkdocs.yml --strict

# Step 8: Build and deploy documentation
- name: Build and deploy documentation
run: mkdocs gh-deploy --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Post-job cleanup (optional step to remove any temporary files if needed)
- name: Cleanup
run: |
echo "Post-job cleanup"
rm -rf ~/pip_cache # Optional: You can remove this if caching is working fine
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site

0 comments on commit 21d53e8

Please sign in to comment.