From d5603bf8ba93ada33452501b420f9026f9bc1ce0 Mon Sep 17 00:00:00 2001 From: 3000ye <87135443+3000ye@users.noreply.github.com> Date: Sun, 25 Feb 2024 14:01:32 +0800 Subject: [PATCH] Create push-pages.yml --- .github/workflows/push-pages.yml | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/push-pages.yml diff --git a/.github/workflows/push-pages.yml b/.github/workflows/push-pages.yml new file mode 100644 index 0000000..b270ffa --- /dev/null +++ b/.github/workflows/push-pages.yml @@ -0,0 +1,51 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Push Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + steps: + - uses: actions/checkout@v3 + + - name: Cache Hugo resources + uses: actions/cache@v3 + env: + cache-name: cache-hugo-resources + with: + path: resources + key: ${{ env.cache-name }} + + - uses: actions/setup-go@v4 + with: + go-version: "^1.17.0" + - run: go version + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: "latest" + extended: true + + - name: Build + run: hugo + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + branch: main + folder: public + commit-message: update pages + clean: true + git-config-name: 3000ye + git-config-email: hcg2924239214@163.com + repository-name: 3000ye/codeBlogPage + single-commit: true