Skip to content

wip: cp docs to gh-pages branch #15

wip: cp docs to gh-pages branch

wip: cp docs to gh-pages branch #15

name: Update Python Package Repository Index
on:
release:
types: [created, edited]
push:
branches:
- main
workflow_dispatch:
jobs:
update-package-index:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install typer PyGithub
- name: Generate Repository Index on Main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python ./workspace/generate_package_index.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }}
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Copy Index to gh-pages Branch
run: |
cp -r docs/* gh-pages/
- name: Commit and Push to gh-pages
working-directory: ./gh-pages
uses: EndBug/add-and-commit@v7
with:
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
message: 'Update package index'
add: '.'
branch: 'gh-pages'
token: ${{ secrets.GITHUB_TOKEN }}
update-package-index:

Check failure on line 59 in .github/workflows/update_repository.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/update_repository.yml

Invalid workflow file

You have an error in your yaml syntax on line 59
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install typer PyGithub
- name: Generate Repository Index
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python ./workspace/generate_package_index.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }}
- name: Checkout gh-pages
run: git checkout -b gh-pages origin/gh-pages
- name: List branches
run: git branch -r
- name: Commit and Push
uses: EndBug/add-and-commit@v7
with:
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
message: 'Update package index'
add: 'docs/'
branch: 'gh-pages'
token: ${{ secrets.GITHUB_TOKEN }}