Skip to content

Commit 957e2c9

Browse files
committed
pages: use github actions as build source
- remove older build config (Classic Pages)
1 parent 7c4aa74 commit 957e2c9

2 files changed

Lines changed: 49 additions & 56 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/gh-pages.yml

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build GH-Pages
1+
name: Deploy Hugo PaperMod Demo to Pages
22

33
on:
44
push:
@@ -17,31 +17,61 @@ on:
1717
required: false
1818
default: "0.83.0"
1919

20+
# Allow one concurrent deployment
21+
concurrency:
22+
group: "pages"
23+
cancel-in-progress: true
24+
25+
# Default to bash
26+
defaults:
27+
run:
28+
shell: bash
29+
30+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
31+
permissions:
32+
contents: read
33+
pages: write
34+
id-token: write
35+
2036
jobs:
21-
deploy:
37+
# Build job
38+
build:
2239
runs-on: ubuntu-latest
40+
env:
41+
HUGO_VERSION: "${{ github.event.inputs.hugoVersion || "0.83.0" }}"
2342
steps:
24-
- name: Git checkout
25-
uses: actions/checkout@v2
43+
- name: Install Hugo CLI
44+
run: |
45+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb \
46+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
47+
- name: Checkout
48+
uses: actions/checkout@v3
2649
with:
2750
ref: exampleSite
28-
51+
- name: Setup Pages
52+
id: pages
53+
uses: actions/configure-pages@v1
2954
- name: Get Theme
3055
run: git submodule update --init --recursive
31-
3256
- name: Update theme to Latest commit
3357
run: git submodule update --remote --merge
34-
35-
- name: Setup hugo
36-
uses: peaceiris/actions-hugo@v2
58+
- name: Build with Hugo
59+
run: |
60+
hugo \
61+
--buildDrafts --gc --verbose \
62+
--baseURL ${{ steps.pages.outputs.base_url }}
63+
- name: Upload artifact
64+
uses: actions/upload-pages-artifact@v1
3765
with:
38-
hugo-version: "${{ github.event.inputs.hugoVersion }}"
39-
40-
- name: Build
41-
run: hugo --buildDrafts --gc --verbose --minify
42-
43-
- name: Deploy
44-
uses: peaceiris/actions-gh-pages@v3
45-
with:
46-
github_token: ${{ secrets.TOKEN }}
47-
publish_dir: ./public
66+
path: ./public
67+
# Deployment job
68+
deploy:
69+
environment:
70+
name: github-pages
71+
url: ${{ steps.deployment.outputs.page_url }}
72+
runs-on: ubuntu-latest
73+
needs: build
74+
steps:
75+
- name: Deploy to GitHub Pages
76+
id: deployment
77+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)