Skip to content

Commit

Permalink
Test: different action
Browse files Browse the repository at this point in the history
  • Loading branch information
José Luís Rodrigues committed Feb 21, 2024
1 parent 571eb21 commit bc36a72
Showing 1 changed file with 13 additions and 37 deletions.
50 changes: 13 additions & 37 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,18 @@
name: "Docs Update"
name: Deploy Sphinx documentation to Pages

on:
push:
branches:
- test-action
branches: [test-action] # branch to trigger deployment

jobs:
docs:
runs-on: ubuntu-latest
pages:
runs-on: ubuntu-20.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v1

# Upgrade pip
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Copy requirements.txt to docs folder
run: cp requirements.txt docs/

- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
- name: Prepare for documentation update
run: |
mkdir -p gh-pages
git clone https://github.com/${{ github.repository }}.git --branch gh-pages --single-branch gh-pages
- name: Copy documentation files
run: cp -r docs/_build/html/* gh-pages/
- name: Commit documentation changes
run: |
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
- id: deployment
uses: sphinx-notes/pages@v3

0 comments on commit bc36a72

Please sign in to comment.