Red.git | .github/workflows/ | create-docs.yml


name: create-docs
on:
  push:
    branches:
      - master
jobs:
  perl6:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: docker/setup-buildx-action@v3

      - name: Build docs image
        uses: docker/build-push-action@v6
        with:
          context: .
          file: Dockerfile-no-run
          tags: red-docs:latest
          push: false
          load: true
          cache-from: type=gha
          cache-to: type=gha,mode=max

      - name: Create local changes
        run: |
          docker run --rm \
            -v "$PWD":/code -w /code \
            --entrypoint "" \
            red-docs:latest raku tools/make-docs.raku

      - name: Commit files
        run: |
          git config --local user.email "action@github.com"
          git config --local user.name "GitHub Action"
          git add .
          git commit -m "Create docs" -a || true

      - name: Push changes
        uses: ad-m/github-push-action@v1.3.0
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}