Welcome to mirror list, hosted at ThFree Co, Russian Federation.

update-demo-page.yml « workflows « .github - github.com/Lednerb/bilberry-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 77d056e36854f8f2b68ece11add228ed111e8134 (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
name: Update GitHub Pages

on:
  push:
    branches:
      - master

jobs:

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          # extended: true

      - name: Run tests
        run: ./testing/testing-example-site/test-theme.sh

  deploy:
    runs-on: ubuntu-latest
    needs: test
    steps:
      - uses: actions/checkout@v2

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          # extended: true

      - name: Create new demo site
        run: hugo new site /tmp/demo-site

      - name: Copy exampleSite content to new site
        run: cp -r ./exampleSite/* /tmp/demo-site

      - name: Adjust the baseURL for gh-pages
        run: sed -i "s/baseURL = .*$/baseURL = \"https:\/\/lednerb.github.io\/bilberry-hugo-theme\/\"/" /tmp/demo-site/config.toml

      - name: Init Hugo module
        working-directory: /tmp/demo-site
        run: hugo mod init github.com/Lednerb/bilberry-hugo-theme/exampleSite

      - name: Build
        working-directory: /tmp/demo-site
        run: hugo && > public/.nojekyll

      - name: Deploy to GitHub Pages
        if: success()
        uses: crazy-max/ghaction-github-pages@v3
        with:
          target_branch: gh-pages
          build_dir: ../../../../../../../../tmp/demo-site/public
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}