Skip to content
name: Generate page docs
on: push
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker
run: |
cp .env.dist .env
docker-compose build
- name: Run Docker
run: |
docker-compose up -d
- name: Create docs directory if it doesn't exist
run: |
if [ ! -d "docs" ]; then
mkdir -p docs
fi
- name: Fetch page docs
run: |
until $(curl -o docs/index.html --silent --head --fail http://0.0.0.0:8000/api/docs); do
sleep 1
done
- uses: EndBug/add-and-commit@v9
with:
default_author: github_action
- uses: actions/checkout@v3
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add docs/index.html
git commit -m "generated"
git push
- name: Commit files
run: |
git config --local user.email "fast.code.auth@gmail.com"
git config --local user.name "ProFastCode"
git add docs/index.html
git commit -a -m "Add changes"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PAT }}
force_with_lease: true