Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
houko committed Jan 1, 2024
1 parent 507acc7 commit 39f523f
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yaml
@@ -0,0 +1,57 @@
name: CI

on: [ push ]

jobs:
deploy:
env:
HUGO_VERSION: ${{ github.sha }}
TZ: Asia/Tokyo
runs-on: ubuntu-latest

steps:
- name: Git checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true

- name: Set git config core.quotepath false # https://github.com/gohugoio/hugo/issues/9810#issuecomment-1107519804
run: git config --global core.quotepath false

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: Install Theme
run: cd themes/hugo-theme-luna && yarn install --production

- name: Install PostCSS-CLI
run: npm install postcss-cli -g

- name: Setup hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.104.0'
extended: true

- name: Build Hugo
run: echo "HUGO_VERSION -> $HUGO_VERSION" && hugo --gc --minify --cleanDestinationDir

- name: Hugo-Encrypt
run: cd themes/hugo-theme-luna && node ./hugo-encrypt.js

- name: Setup CNAME
run: echo "https://blog.xiaomo.info" > ./public/CNAME

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.TOKEN }}
external_repository: "houko/houko.github.io"
publish_branch: gh-pages
publish_dir: ./public
force_orphan: true
user_name: houko
user_email: suzukaze.hazuki2020@gmail.com

0 comments on commit 39f523f

Please sign in to comment.