Skip to content

Correct git fetch-depth #36

Correct git fetch-depth

Correct git fetch-depth #36

Workflow file for this run

name: Main
on:
workflow_dispatch:
inputs:
publish_artifacts:
description: "Publish artifacts (Y|N)"
required: true
default: "N"
release:
types: [published]
push:
branches:
- main
- dev
paths-ignore:
- README.md
pull_request:
branches:
- "*"
paths-ignore:
- README.md
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: false
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U pip
pip install -r requirements.txt
- name: Build and pack docs
run: |
./pack.sh
- name: Upload distribution package
uses: actions/upload-artifact@v4
with:
name: site
path: site.zip
publish:
if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_artifacts == 'Y')
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: gh-pages
path: neoteroi
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: site
path: site
- name: Unzip artifact
run: |
unzip site/site.zip -d site
- name: Deploy to gh-pages branch
run: |
find neoteroi -mindepth 1 ! -name '.git' ! -name 'CNAME' ! -name 'README.md' ! -path 'neoteroi/.git/*' -exec rm -rf {} +
cp -r site/site/* neoteroi/
cd neoteroi
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m "Deploy documentation on $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
git push origin gh-pages
echo "Published to gh-pages"