Merge pull request #132 from johnlettman/dependabot/npm_and_yarn/webp… #129
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: GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
jobs: | |
pages: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Generate documentation | |
run: yarn docs | |
- name: Prepare tag | |
id: prepare_tag | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
TAG_NAME="${GITHUB_REF##refs/tags/}" | |
echo "::set-output name=tag_name::${TAG_NAME}" | |
echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}" | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }} | |
tag_message: 'Deployment ${{ github.ref_name }}' |