chore: update workflows to trigger on completion of Docker Build, Publish & Test
This commit is contained in:
26
.github/workflows/docs.yml
vendored
26
.github/workflows/docs.yml
vendored
@@ -1,20 +1,9 @@
|
||||
name: Deploy Documentation to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
- '.github/workflows/docs.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
- '.github/workflows/docs.yml'
|
||||
workflow_run:
|
||||
workflows: ["Docker Build, Publish & Test"]
|
||||
types: [completed]
|
||||
workflow_dispatch: # Allow manual trigger
|
||||
|
||||
# Sets permissions to allow deployment to GitHub Pages
|
||||
@@ -25,7 +14,7 @@ permissions:
|
||||
|
||||
# Allow only one concurrent deployment
|
||||
concurrency:
|
||||
group: "pages-${{ github.event_name }}-${{ github.ref }}"
|
||||
group: "pages-${{ github.event_name }}-${{ github.event.workflow_run.head_branch || github.ref }}"
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
@@ -36,6 +25,7 @@ jobs:
|
||||
name: Build Documentation
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
env:
|
||||
REPO_NAME: ${{ github.event.repository.name }}
|
||||
|
||||
@@ -43,6 +33,8 @@ jobs:
|
||||
# Step 1: Get the code
|
||||
- name: 📥 Checkout code
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
|
||||
|
||||
# Step 2: Set up Node.js (for building any JS-based doc tools)
|
||||
- name: 🔧 Set up Node.js
|
||||
@@ -366,7 +358,9 @@ jobs:
|
||||
|
||||
deploy:
|
||||
name: Deploy to GitHub Pages
|
||||
if: github.ref == 'refs/heads/main'
|
||||
if: >-
|
||||
(github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main') ||
|
||||
(github.event_name != 'workflow_run' && github.ref == 'refs/heads/main')
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
Reference in New Issue
Block a user