Back
Featured image of post Hello, Hugo

Hello, Hugo

GitHub Codespaces + GitHub Actions + GitHub Pages

Actions 示例配置

name: Build

on: push

jobs:
  build:
    name: Build
    runs-on: ubuntu-20.04

    steps:
    - name: Check out repository
      uses: actions/checkout@v2

    - name: Install dependencies
      run: |
        wget https://github.com/gohugoio/hugo/releases/download/v0.79.1/hugo_extended_0.79.1_Linux-64bit.tar.gz
        tar -zxvf hugo_extended_0.79.1_Linux-64bit.tar.gz        

    - name: Build
      run: ./hugo -D

    - name: Set up Git infomation
      run: | 
        git config --global user.name 'Dreamy.WJY' 
        git config --global user.email 'wjy@wjy.me'

    - name: Deploy
      run: | 
        cd public
        echo 'jingyuan.wang' > CNAME
        git init
        git add -A
        git commit -m "Update"
        git push -f https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.actor }}/Hugo.git master:pages
comments powered by Disqus