Skip to content

Commit

Permalink
clean up workflow script and docs directory
Browse files Browse the repository at this point in the history
  • Loading branch information
juliagsy committed Jul 11, 2023
1 parent 7521a9e commit 823a34c
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 153 deletions.
143 changes: 130 additions & 13 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,130 @@
# name: Update docs
# on:
# push:
# branches:
# - master
# tags:
# - v*

# jobs:
# update-docs:
# name: Update docs
# uses: unifyai/workflows/.github/workflows/docs.yml@master
# secrets: inherit
name: Update docs

on:
push:
branches:
- master
tags:
- v*
# workflow_call:
# secrets:
# SSH_GH_PAGES:
# description: 'SSH key for GitHub Pages deployment'
# required: true
# inputs:
# package-dependencies:
# description: 'Apt package dependencies'
# required: false
# default: ''
# type: string

jobs:
wait-for-others:
name: Wait For Other Workflows To Complete
runs-on: ubuntu-latest
steps:
- name: Wait for other workflows
uses: mktcode/consecutive-workflow-action@eb43c6b5852dd0e33efa797a1817196d06daa4b2
with:
token: ${{ secrets.GITHUB_TOKEN }}

publish-dev-docs:
name: Publish dev docs
runs-on: ubuntu-latest
needs: wait-for-others
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Install Python and Dependencies
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt

- name: Render Docs
uses: quarto-dev/quarto-actions/render@v2
with:
to: html

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
folder: docs
target-folder: "${{ github.event.repository.name }}"
ssh-key: ${{ secrets.SSH_GH_PAGES }}
branch: master
git-config-name: ivy-seed
git-config-email: ivydl.team@gmail.com
repository-name: unifyai/docs
clean: true

publish-release-docs:
name: Publish release docs
runs-on: ubuntu-latest
needs: wait-for-others
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Install Python and Dependencies
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt

- name: Render Docs
uses: quarto-dev/quarto-actions/render@v2
with:
to: html

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
folder: docs
target-folder: "${{ github.ref_name != 'dev' && format('{0}/', github.ref_name) || '' }}${{ github.event.repository.name }}"
ssh-key: ${{ secrets.SSH_GH_PAGES }}
branch: master
git-config-name: ivy-seed
git-config-email: ivydl.team@gmail.com
repository-name: unifyai/docs
clean: true

update-versions:
name: Update versions.json
runs-on: ubuntu-latest
needs: publish-release-docs
steps:
- name: Checkout 🛎️ Docs
uses: actions/checkout@v3
with:
repository: unifyai/docs
ssh-key: ${{ secrets.SSH_GH_PAGES }}

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

- name: Add version to ${{ github.event.repository.name }}.json
run: |
python versions/add_version.py ${{ github.event.repository.name }} ${{ github.ref_name }}
- name: Commit and push
run: |
git config --global user.email "ivydl.team@gmail.com"
git config --global user.name "ivy-seed"
git add versions/
git commit -m "Add ${{ github.ref_name }} to ${{ github.event.repository.name }}.json"
git push
130 changes: 0 additions & 130 deletions .github/workflows/new_docs.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ autogenerated_source/
*.json
.DS_Store
.quarto/
docs/
docs/
/.quarto/
1 change: 0 additions & 1 deletion docs/index.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/partial_conf.py

This file was deleted.

0 comments on commit 823a34c

Please sign in to comment.