Skip to content

Commit af6d823

Browse files
authored
Create gh-pages.yml
1 parent c0b31fb commit af6d823

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Sample workflow for building and deploying a Hugo site to GitHub Pages
2+
name: Deploy Hugo site to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["master"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow one concurrent deployment
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: true
22+
23+
# Default to bash
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
jobs:
29+
# Build job
30+
build:
31+
runs-on: ubuntu-latest
32+
env:
33+
HUGO_VERSION: 0.102.3
34+
steps:
35+
- name: Install Hugo CLI
36+
run: |
37+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb \
38+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
with:
42+
submodules: recursive
43+
- name: Setup Pages
44+
id: pages
45+
uses: actions/configure-pages@v2
46+
- name: Build with Hugo
47+
env:
48+
# For maximum backward compatibility with Hugo modules
49+
HUGO_ENVIRONMENT: production
50+
HUGO_ENV: production
51+
run: |
52+
hugo \
53+
--minify \
54+
--baseURL "${{ steps.pages.outputs.base_url }}/"
55+
- name: Upload artifact
56+
uses: actions/upload-pages-artifact@v1
57+
with:
58+
path: ./public
59+
60+
# Deployment job
61+
deploy:
62+
environment:
63+
name: github-pages
64+
url: ${{ steps.deployment.outputs.page_url }}
65+
runs-on: ubuntu-latest
66+
needs: build
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)