summaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
blob: 7dddd44cb8f269348835b105342309f65b6185a7 (plain)
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
name: Website and Doxygen

on:
  push:
  schedule:
    - cron: '0 0 * * 0'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Dillo Website repo
      uses: actions/checkout@v4
      with:
        repository: 'dillo-browser/dillo-browser.github.io'
        path: web
    - name: Checkout Dillo repo
      uses: actions/checkout@v4
      with:
        repository: 'dillo-browser/dillo'
        path: dillo
        fetch-depth: 0 # Required for "git describe" to work properly
    - name: Set the Dillo git commit in Doxygen config
      working-directory: dillo/
      run: |
        sed -i "s/^PROJECT_NUMBER  *=/PROJECT_NUMBER=$(git describe)/" Doxyfile
        grep PROJECT_NUMBER Doxyfile
    - name: Build Doxygen docs
      uses: mattnotmitt/doxygen-action@1.9.8
      with:
        working-directory: 'dillo/'
        # Doesn't work as we are not enabling the PDF output, but generating
        # images of LaTeX formular in the HTML output.
        # enable-latex: true
        # So we simply add LaTeX the packages manually:
        additional-packages: 'perl build-base texlive-full biblatex ghostscript'
    - name: Copy Doxygen docs to website directory
      run: |
        # For some reason they are generated by root user
        cp -a dillo/html web/doxygen
    - name: Upload Artifact
      uses: actions/upload-pages-artifact@v3
      with:
        path: web/

  deploy:
    if: github.ref == 'refs/heads/master'
    needs: build

    # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
    permissions:
      pages: write      # to deploy to Pages
      id-token: write   # to verify the deployment originates from an appropriate source

    # Deploy to the github-pages environment
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}

    # Specify runner + deployment step
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4