Skip to content

Commit

Permalink
add some actions
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed Sep 8, 2023
1 parent 9656460 commit 3f9aa79
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/pr-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: delete preview on PR close
on:
pull_request:
types: [closed]

jobs:
delete_preview:
runs-on: ubuntu-latest
env:
PR_PATH: pull/${{github.event.number}}
steps:
- name: make empty dir
run: mkdir ${{ env.PR_PATH }}

- name: delete folder
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.PR_PATH }}
destination_dir: ${{ env.PR_PATH }}

- name: Comment on PR
uses: hasura/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
number: ${{ github.event.number }}
id: deploy-preview
message: "🪓 PR closed, deleted preview at https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}/"
54 changes: 54 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: github pages

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * 1'

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
env:
PR_PATH: pull/${{github.event.number}}
steps:
- name: Comment on PR
uses: hasura/[email protected]
if: github.ref != 'refs/heads/master'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
number: ${{ github.event.number }}
id: deploy-preview
message: "Starting deployment of preview ⏳..."

- name: Checkout website repo
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt

- name: Build website
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "."

- name: Upload HTML
uses: actions/upload-artifact@v1
with:
name: DocumentationHTML
path: _build/html/

0 comments on commit 3f9aa79

Please sign in to comment.