Skip to content

Workflow file for this run

name: Deploy to Github Pages And Cloudflare Pages
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
environment:
name: hugo-page
url: http://blog-g.leecq.cn
steps:
- uses: actions/checkout@v2
- name: Cache Hugo resources
uses: actions/cache@v2
env:
cache-name: cache-hugo-resources
with:
path: resources
key: ${{ env.cache-name }}
- uses: actions/setup-go@v2
with:
go-version: "^1.17.0"
- run: go version
- name: Cache Go Modules
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true
- name: Build
run: |
hugo --minify --gc --baseURL https://blog-g.leecq.cn/ --destination public-gh-page;
hugo --minify --gc --destination public-cf-page;
hugo --minify --gc --baseURL https://blog.leecq.cn/ --destination public-blog;
- name: Deploy Github Page 🚀
uses: JamesIves/[email protected]
with:
branch: public-gh-page
folder: public-gh-page
clean: true
single-commit: true
- name: Deploy Cloudflare Pages 🚀
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_PAGES_ALL }}
accountId: 4c0d482d9563546189367a54fe77a3df
projectName: hugo-blog
directory: public-cf-page
gitHubToken: ${{ secrets.GITHUB_TOKEN }}