summaryrefslogtreecommitdiffstats
path: root/.github/workflows/cd.yml
blob: 2441965d1e83f017c5e790e0732badaf68169a55 (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
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 }}"
          extended: true

      - name: Build local ./exampleSite
        run: hugo --minify --gc --destination ../public --source ./exampleSite --baseURL https://sergeyklay.github.io/gohugo-theme-ed/

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