123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- name: Deploy on Github Pages
- on:
- push:
- branches:
- - master
- # Allows you to run this workflow manually from the Actions tab
- workflow_dispatch:
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
- permissions:
- contents: read
- pages: write
- id-token: write
- # Allow one concurrent deployment
- concurrency:
- group: "pages"
- cancel-in-progress: true
- # Default to bash
- defaults:
- run:
- shell: bash
- jobs:
- build:
- runs-on: ubuntu-22.04
- steps:
- - uses: actions/checkout@v3
- with:
- submodules: true # Fetch Hugo themes (true OR recursive)
- fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- - name: Setup Pages
- id: pages
- uses: actions/configure-pages@v2
- - name: Setup Hugo
- uses: peaceiris/actions-hugo@v2
- with:
- hugo-version: "0.124.1"
- extended: true
- - name: Setup Node
- uses: actions/setup-node@v3
- with:
- node-version: '20'
- cache: 'npm'
- cache-dependency-path: '**/package-lock.json'
- - name: Install Node dependencies
- run: npm ci
- - name: Build
- run: hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- - name: Upload artifact
- uses: actions/upload-pages-artifact@v1
- with:
- path: ./public
- # Deployment job
- 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@v1
|