summaryrefslogtreecommitdiffstats
path: root/.github/workflows/cd.yml
blob: 1a209cf09a8afe2fcc7762bfd27a7c0dbd6a78a4 (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
name: CD

on:
  push:
    paths-ignore:
      - "LICENSE"
      - "README.md"
    branches:
      - master
  workflow_dispatch:
    # manual run
    inputs:
      hugoVersion:
        description: "Hugo Version"
        required: false
        default: "0.84.0"

jobs:
  deploy:
    runs-on: ubuntu-20.04
    name: Build GH-Pages
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Setup hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: "${{ github.event.inputs.hugoVersion }}"

      - name: Build
        run: |
          hugo --source=exampleSite --buildDrafts --gc --verbose --minify
          cp -R ./exampleSite/public ./docs

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./docs