File: docs.yml

package info (click to toggle)
fenics-ufl 2025.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,176 kB
  • sloc: python: 25,267; makefile: 170
file content (80 lines) | stat: -rw-r--r-- 2,122 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build UFL Documentation
on:
  workflow_call:
    inputs:
      deploy:
        description: "Upload to fenicsproject.org"
        default: false
        type: boolean
    secrets:
      SSH_GITHUB_DOCS_PRIVATE_KEY:
        required: false

  workflow_dispatch:
    inputs:
      deploy:
        description: "Upload to fenicsproject.org"
        default: false
        type: boolean

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v5
        with:
          ref: ${{ github.sha }}

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: 3.12

      - name: Install UFL
        run: python -m pip install .[docs]

      - name: Build documentation
        run: |
          cd doc
          make html

      - name: Upload documentation artifact
        uses: actions/upload-artifact@v4
        with:
          name: documentation
          path: doc/build/html/
          retention-days: 2
          if-no-files-found: error

      - name: Checkout FEniCS/docs
        if: ${{ inputs.deploy == true }}
        uses: actions/checkout@v5
        with:
          repository: "FEniCS/docs"
          ref: "main"
          path: "docs"
          ssh-key: "${{ secrets.SSH_GITHUB_DOCS_PRIVATE_KEY }}"

      - name: Set version name
        if: ${{ inputs.deploy == true }}
        run: |
          echo "VERSION_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

      - name: Copy documentation into repository
        if: ${{ inputs.deploy == true }}
        run: |
          cd docs
          git rm -r --ignore-unmatch ufl/${{ env.VERSION_NAME }}
          mkdir -p ufl/${{ env.VERSION_NAME }}
          cp -r ../doc/build/html/* ufl/${{ env.VERSION_NAME }}

      - name: Commit and push documentation to FEniCS/docs
        if: ${{ inputs.deploy == true }}
        run: |
          cd docs
          git config --global user.email "fenics@github.com"
          git config --global user.name "FEniCS GitHub Actions"
          git add --all
          git commit --allow-empty -m "Python FEniCS/ufl@${{ github.sha }}"
          git push