Bump dawidd6/action-send-mail from 3 to 4
[yosql.git] / .github / workflows / website.yml
blob7e3afb6258777e6fc05239dbc181fbf3055e5dcb
1 name: Publish Website
2 on:
3   push:
4     branches:
5       - main
6     paths:
7       - .github/workflows/website.yml
8       - yosql-website/**
9 env:
10   JAVA_VERSION: 17
11   PROJECT_URL: yosql.projects.metio.wtf
12 jobs:
13   website:
14     name: Website
15     runs-on: ubuntu-latest
16     steps:
17       - id: checkout
18         name: Clone Git Repository
19         uses: actions/checkout@v4
20         with:
21           fetch-depth: 0 # required in order to get all tags
22       - id: hugo
23         name: Setup Hugo
24         uses: peaceiris/actions-hugo@v3
25         with:
26           hugo-version: latest
27       - id: graal
28         name: Setup GraalVM
29         uses: graalvm/setup-graalvm@v1
30         with:
31           distribution: graalvm
32           java-version: ${{ env.JAVA_VERSION }}
33           github-token: ${{ secrets.GITHUB_TOKEN }}
34           cache: maven
35       - id: previous
36         name: Get Last Release
37         run: echo "version=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT
38       - name: Set release version
39         run: mvn --batch-mode --define newVersion=${{ steps.previous.outputs.version }} --define generateBackupPoms=false versions:set
40       - id: create-documentation
41         name: Create Documentation
42         run: mvn --batch-mode --projects yosql-website --also-make --define skipTests install
43       - id: website
44         name: Build Website
45         run: hugo --minify --printI18nWarnings --printPathWarnings --printUnusedTemplates --source yosql-website
46         env:
47           YOSQL_RELEASE: ${{ steps.previous.outputs.version }}
48       - id: htmltest
49         name: Run htmltest
50         uses: wjdp/htmltest-action@master
51         with:
52           config: ./yosql-website/htmltest.yml
53       - id: deploy
54         name: Deploy Website
55         uses: peaceiris/actions-gh-pages@v4
56         with:
57           github_token: ${{ secrets.GITHUB_TOKEN }}
58           publish_dir: ./yosql-website/public
59           force_orphan: true
60           cname: ${{ env.PROJECT_URL }}