Skip to content

Commit

Permalink
Fix publish docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Jan 18, 2024
1 parent 1bbac9c commit 7b2c9b1
Showing 1 changed file with 53 additions and 45 deletions.
98 changes: 53 additions & 45 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: "Publish Docs"

on:
push:
branches: [ "master" ]
workflow_run:
workflows: ["CI"]
branches: [master]
Expand All @@ -11,7 +13,7 @@ jobs:
publishing:
name: Publish Documentation
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:

- name: 📥 Checkout repository
Expand All @@ -22,43 +24,59 @@ jobs:
# Also ensure we have all history with all tags
fetch-depth: 0

- name: Get released workflow run id
id: released-workflow
uses: actions/github-script@v6
with:
script: |
let runs = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'ci-nix.yaml',
branch: 'release'
});
return runs.workflow_runs[0].id;
- name: Get latest workflow run id
id: latest-workflow
uses: actions/github-script@v6
with:
script: |
let runs = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'ci-nix.yaml',
branch: 'master'
});
return runs.workflow_runs[0].id;
- name: 📥 Download released hydra-spec
uses: dawidd6/action-download-artifact@v3
uses: actions/download-artifact@v4
with:
repo: input-output-hk/hydra
workflow: ci-nix.yaml
workflow_conclusion: success
branch: release
run-id: ${{steps.released-workflow.outputs.result}}
name: hydra-spec
path: docs/static

- name: 📥 Download released benchmarks
uses: dawidd6/action-download-artifact@v3
uses: actions/download-artifact@v4
with:
repo: input-output-hk/hydra
workflow: ci-nix.yaml
workflow_conclusion: success
branch: release
name: benchmarks
run-id: ${{steps.released-workflow.outputs.result}}
pattern: benchmarks-*
merge-multiple: true
path: docs/benchmarks

- name: 📥 Download released test-results
uses: dawidd6/action-download-artifact@v3
uses: actions/download-artifact@v4
with:
repo: input-output-hk/hydra
workflow: ci-nix.yaml
workflow_conclusion: success
branch: release
name: test-results
run-id: ${{steps.released-workflow.outputs.result}}
pattern: test-results-*
merge-multiple: true
path: docs/benchmarks/tests

- name: 📥 Download released haddock documentation
uses: dawidd6/action-download-artifact@v3
uses: actions/download-artifact@v4
with:
repo: input-output-hk/hydra
workflow: ci-nix.yaml
workflow_conclusion: success
branch: release
run-id: ${{steps.released-workflow.outputs.result}}
name: haddocks
path: docs/static/haddock

Expand Down Expand Up @@ -86,42 +104,32 @@ jobs:
sed -i 's|head-protocol|head-protocol/unstable|' docusaurus.config.js
- name: 📥 Download latest hydra-spec
uses: dawidd6/action-download-artifact@v3
uses: actions/download-artifact@v4
with:
repo: input-output-hk/hydra
workflow: ci-nix.yaml
workflow_conclusion: success
branch: master
run-id: ${{steps.latest-workflow.outputs.result}}
name: hydra-spec
path: docs/static

- name: 📥 Download latest benchmarks
uses: dawidd6/action-download-artifact@v3
uses: actions/download-artifact@v4
with:
repo: input-output-hk/hydra
workflow: ci-nix.yaml
workflow_conclusion: success
branch: master
name: benchmarks
run-id: ${{steps.latest-workflow.outputs.result}}
pattern: benchmarks-*
merge-multiple: true
path: docs/benchmarks

- name: 📥 Download latest test-results
uses: dawidd6/action-download-artifact@v3
uses: actions/download-artifact@v4
with:
repo: input-output-hk/hydra
workflow: ci-nix.yaml
workflow_conclusion: success
branch: master
name: test-results
run-id: ${{steps.latest-workflow.outputs.result}}
pattern: test-results-*
merge-multiple: true
path: docs/benchmarks/tests

- name: 📥 Download latest haddock documentation
uses: dawidd6/action-download-artifact@v3
uses: actions/download-artifact@v4
with:
repo: input-output-hk/hydra
workflow: ci-nix.yaml
workflow_conclusion: success
branch: master
run-id: ${{steps.latest-workflow.outputs.result}}
name: haddocks
path: docs/static/haddock

Expand Down

0 comments on commit 7b2c9b1

Please sign in to comment.