update new docs workflow #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
secrets: inherit | ||
Check failure on line 35 in .github/workflows/new_docs.yml GitHub Actions / Update docsInvalid workflow file
|
||
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: "${{ inputs.version != 'dev' && format('{0}/', inputs.version) || '' }}${{ 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') | ||
secrets: inherit | ||
with: | ||
version: ${{ github.ref_name }} | ||
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: "${{ inputs.version != 'dev' && format('{0}/', inputs.version) || '' }}${{ 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 |