mirror of
https://github.com/zoriya/blog.git
synced 2025-12-06 06:26:10 +00:00
Update github page to new actions
This commit is contained in:
42
.github/workflows/page.yml
vendored
42
.github/workflows/page.yml
vendored
@@ -1,22 +1,32 @@
|
|||||||
name: GitHub Pages
|
name: Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-deploy:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Pages
|
||||||
|
id: pages
|
||||||
|
uses: actions/configure-pages@v4
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v2
|
||||||
with:
|
with:
|
||||||
@@ -24,12 +34,20 @@ jobs:
|
|||||||
extended: true
|
extended: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo --minify
|
run: hugo --gc --minify
|
||||||
|
|
||||||
- name: Deploy
|
- name: Upload artifact
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: actions/upload-pages-artifact@v3
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
path: ./public
|
||||||
publish_branch: gh-pages
|
|
||||||
publish_dir: ./public
|
deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user