Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: build GitHub pages on workflow dispatch #1335

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ on:
release:
types:
- published
workflow_dispatch:
inputs:
ref:
description: 'Git ref (refs/heads/<branch>, refs/tags/<tag>, etc.) or SHA'
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
ref: ${{ inputs.ref || github.ref }}

jobs:
path-filter:
permissions:
Expand All @@ -26,6 +35,8 @@ jobs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.ref }}
- id: filter
uses: dorny/paths-filter@v2
with:
Expand All @@ -42,6 +53,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.ref }}
- run: docker run --rm --volume "${PWD}:/workdir" ghcr.io/igorshubovych/markdownlint-cli:latest --disable MD013 MD033 MD041 MD046 -- "**/*.md"

build:
Expand All @@ -52,14 +65,15 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.ref }}
# the `git-revision-date-localized` plugin needs full history to find page creation date
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
key: ${{ env.ref }}
path: .cache
- run: |
pip install --requirement docs/requirements.txt
Expand All @@ -81,21 +95,22 @@ jobs:
jobs: ${{ toJSON(needs) }}

deploy:
if: github.event_name == 'release'
if: ${{ github.event_name != 'pull_request' }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.ref }}
# the `git-revision-date-localized` plugin needs full history to find page creation date
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
key: ${{ env.ref }}
path: .cache
- run: |
pip install --requirement docs/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
workflow_dispatch:
inputs:
ref:
description: 'Git ref or SHA'
description: 'Git ref (refs/heads/<branch>, refs/tags/<tag>, etc.) or SHA'
required: true
type: string

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
workflow_dispatch:
inputs:
ref:
description: 'Git ref or SHA'
description: 'Git ref (refs/heads/<branch>, refs/tags/<tag>, etc.) or SHA'
required: true
type: string

Expand Down
Loading