Skip to content

Commit

Permalink
CI: build GitHub pages on workflow dispatch (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Aug 31, 2024
1 parent 2c53493 commit 8a2e046
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
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

0 comments on commit 8a2e046

Please sign in to comment.