Skip to content

Commit 6f0c88d

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

2 files changed

Lines changed: 52 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: 52 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,64 @@ 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: "0.83.0"
2342
steps:
24-
- name: Git checkout
25-
uses: actions/checkout@v2
43+
- name: Check version
44+
if: ${{ github.event.inputs.hugoVersion }}
45+
run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}"
46+
- name: Install Hugo CLI
47+
run: |
48+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb \
49+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
50+
- name: Checkout
51+
uses: actions/checkout@v3
2652
with:
2753
ref: exampleSite
28-
54+
- name: Setup Pages
55+
id: pages
56+
uses: actions/configure-pages@v1
2957
- name: Get Theme
3058
run: git submodule update --init --recursive
31-
3259
- name: Update theme to Latest commit
3360
run: git submodule update --remote --merge
34-
35-
- name: Setup hugo
36-
uses: peaceiris/actions-hugo@v2
61+
- name: Build with Hugo
62+
run: |
63+
hugo \
64+
--buildDrafts --gc --verbose \
65+
--baseURL ${{ steps.pages.outputs.base_url }}
66+
- name: Upload artifact
67+
uses: actions/upload-pages-artifact@v1
3768
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
69+
path: ./public
70+
# Deployment job
71+
deploy:
72+
environment:
73+
name: github-pages
74+
url: ${{ steps.deployment.outputs.page_url }}
75+
runs-on: ubuntu-latest
76+
needs: build
77+
steps:
78+
- name: Deploy to GitHub Pages
79+
id: deployment
80+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)