source: tanzpartie-hugo/themes/bilberry-hugo-theme/.github/workflows/update-demo-page.yml @ 17727

Last change on this file since 17727 was 16971, checked in by Henrik Bettermann, 2 years ago
File size: 1.5 KB
RevLine 
[16971]1name: Update GitHub Pages
2
3on:
4  push:
5    branches:
6      - master
7
8jobs:
9
10  test:
11    runs-on: ubuntu-latest
12    steps:
13      - uses: actions/checkout@v2
14
15      - name: Setup Hugo
16        uses: peaceiris/actions-hugo@v2
17        with:
18          hugo-version: 'latest'
19          # extended: true
20
21      - name: Run tests
22        run: ./testing/testing-example-site/test-theme.sh
23
24  deploy:
25    runs-on: ubuntu-latest
26    needs: test
27    steps:
28      - uses: actions/checkout@v2
29
30      - name: Setup Hugo
31        uses: peaceiris/actions-hugo@v2
32        with:
33          hugo-version: 'latest'
34          # extended: true
35
36      - name: Create new demo site
37        run: hugo new site /tmp/demo-site
38
39      - name: Copy exampleSite content to new site
40        run: cp -r ./exampleSite/* /tmp/demo-site
41
42      - name: Adjust the baseURL for gh-pages
43        run: sed -i "s/baseURL = .*$/baseURL = \"https:\/\/lednerb.github.io\/bilberry-hugo-theme\/\"/" /tmp/demo-site/config.toml
44
45      - name: Init Hugo module
46        working-directory: /tmp/demo-site
47        run: hugo mod init github.com/Lednerb/bilberry-hugo-theme/exampleSite
48
49      - name: Build
50        working-directory: /tmp/demo-site
51        run: hugo && > public/.nojekyll
52
53      - name: Deploy to GitHub Pages
54        if: success()
55        uses: crazy-max/ghaction-github-pages@v3
56        with:
57          target_branch: gh-pages
58          build_dir: ../../../../../../../../tmp/demo-site/public
59        env:
60          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Note: See TracBrowser for help on using the repository browser.