build(deps): bump the docs-dependencies group across 1 directory with… #955
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
# .github/workflows/preview.yml | |
name: Deploy Github Pages | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "docs/**" | |
- ".github/workflows/publish-page.yml" | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- closed | |
paths: | |
- "docs/**" | |
- ".github/workflows/publish-page.yml" | |
permissions: | |
contents: write | |
pull-requests: write | |
concurrency: ci-${{ github.ref }} | |
jobs: | |
publish: | |
# Do not run this on forks: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'grafana/tanka' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install pnpm | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 | |
with: | |
version: 9 | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
cache-dependency-path: 'docs' | |
- name: Install and Build | |
working-directory: docs | |
env: | |
# Main: https://tanka.dev/ | |
# PRs: https://tanka.dev/pr-preview/pr-{number}/ | |
PATH_PREFIX: "${{ github.event_name == 'pull_request' && format('/pr-preview/pr-{0}/', github.event.number) || '' }}" | |
run: | | |
pnpm install | |
pnpm build | |
if [ -d "./public" ]; then | |
touch ./public/.nojekyll | |
fi | |
if [ -d "./dist" ]; then | |
touch ./dist/.nojekyll | |
fi | |
- name: Deploy main | |
if: github.event_name != 'pull_request' | |
uses: JamesIves/github-pages-deploy-action@15de0f09300eea763baee31dff6c6184995c5f6a # v4.7.2 | |
with: | |
clean-exclude: pr-preview/ | |
folder: ./docs/dist/ | |
- name: Deploy preview | |
if: github.event_name == 'pull_request' | |
uses: rossjrw/pr-preview-action@430e3dfc1de8a8ae77e77d862d25676ef9db55d1 # v1.4.8 | |
with: | |
deploy-repository: ${{ github.event.pull_request.head.repo.full_name }} | |
source-dir: ./docs/dist/ |