Skip to content

Commit 0b552d0

Browse files
authored
Merge pull request #1 from otomore/feature/hugo-upgrade-and-ci
Hugo アップグレードと GitHub Actions CI/CD の追加
2 parents 1d0fbb5 + 58c21bd commit 0b552d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+100
-9806
lines changed

.github/workflows/deploy.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Hugo build and deploy to GitHub Pages
2+
name: Deploy Hugo site to Pages
3+
4+
on:
5+
# Runs on pushes targeting the source branch
6+
push:
7+
branches:
8+
- source
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
# Default to bash
25+
defaults:
26+
run:
27+
shell: bash
28+
29+
jobs:
30+
# Build job
31+
build:
32+
runs-on: ubuntu-latest
33+
env:
34+
HUGO_VERSION: 0.139.4
35+
steps:
36+
- name: Install Hugo CLI
37+
run: |
38+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
39+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
40+
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
with:
44+
submodules: recursive
45+
fetch-depth: 0
46+
47+
- name: Setup Pages
48+
id: pages
49+
uses: actions/configure-pages@v5
50+
51+
- name: Build with Hugo
52+
env:
53+
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
54+
HUGO_ENVIRONMENT: production
55+
TZ: Asia/Tokyo
56+
run: |
57+
hugo \
58+
--gc \
59+
--minify \
60+
--baseURL "${{ steps.pages.outputs.base_url }}/"
61+
62+
- name: Upload artifact
63+
uses: actions/upload-pages-artifact@v3
64+
with:
65+
path: ./public
66+
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@v4

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Hugo build output
2+
public/
3+
docs/
4+
5+
# Hugo resources
6+
resources/_gen/
7+
8+
# OS generated files
9+
.DS_Store
10+
Thumbs.db
11+
12+
# Editor directories
13+
.idea/
14+
.vscode/
15+
*.swp
16+
*.swo

config.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ languageCode = "en-us"
44
enableRobotsTXT = true
55
disableKinds=["RSS"]
66
googleAnalytics = "UA-123-45"
7-
publishDir = "docs"
7+
# publishDir removed - using default "public" for GitHub Actions
88

9-
[blackfriday]
10-
hrefTargetBlank = true
9+
# Markup settings (Hugo 0.60+)
10+
[markup]
11+
[markup.goldmark]
12+
[markup.goldmark.renderer]
13+
unsafe = true # Allow raw HTML in markdown
1114

1215
[params]
1316
description = '<!--[-->Otomore is a Developer based in Tokyo.<!--]--><br />

0 commit comments

Comments
 (0)