chore(deps): update all github action dependencies #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy docs | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'docs/**' | |
- '.github/workflows/build-deploy-docs.yaml' | |
pull_request: | |
paths: | |
- 'docs/**' | |
- '.github/workflows/build-deploy-docs.yaml' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
with: | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@b8130d9ab958b325bbde9786d62f2c97a9885a0e # v3.0.7 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d # v2.6.0 | |
with: | |
hugo-version: '0.111.2' | |
extended: true | |
- name: Setup Node | |
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
# The action defaults to search for the dependency file (package-lock.json, | |
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its | |
# hash as a part of the cache key. | |
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data | |
cache-dependency-path: '**/package-lock.json' | |
- name: Install Node dependencies | |
working-directory: docs | |
run: npm ci | |
- name: Build the Hugo website | |
working-directory: docs | |
run: hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/" | |
- name: Upload artifact | |
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' | |
uses: actions/upload-pages-artifact@84bb4cd4b733d5c320c9c9cfbc354937524f4d64 # v1.0.10 | |
with: | |
path: docs/public | |
deploy: | |
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Allow one concurrent deployment | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@de14547edc9944350dc0481aa5b7afb08e75f254 # v2.0.5 | |