diff --git a/.github/workflows/contracts-ecdsa-docs.yml b/.github/workflows/contracts-ecdsa-docs.yml index ce2ed8c7bd..861a02dd7b 100644 --- a/.github/workflows/contracts-ecdsa-docs.yml +++ b/.github/workflows/contracts-ecdsa-docs.yml @@ -49,6 +49,29 @@ jobs: commentPR: true exportAsGHArtifacts: true + # This job is needed to avoid a clash of `contracts-docs-publish` jobs for + # `random-beacon` and `ecdsa` projects (if both are run and pull the code at + # the same time and try to push to the same branch, one of them will fail). + contracts-docs-prepublish-wait: + name: Wait for contracts docs to be published + needs: contracts-docs-publish-preview + # TODO: remove last OR + if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')) || github.ref == 'refs/pull/3534/merge' + runs-on: ubuntu-latest + steps: + # We want to minimize the risk the next step executes at the same time as + # the similar step in Random Beacon. + - name: Wait 10 seconds + run: sleep 10 + - name: Wait for `random-beacon` docs to be published + uses: lewagon/wait-on-check-action@v1.3.1 + with: + ref: ${{ github.ref }} + check-name: 'Publish contracts documentation' + repo-token: ${{ secrets.GITHUB_TOKEN }} + # 120s is a value for testing purposes. TODO: change to 10s + wait-interval: 120 + # This job will be triggered for releases which name starts with # `refs/tags/solidity/`. It will generate contracts documentation in # Markdown and sync it with a specific path of @@ -57,9 +80,7 @@ jobs: # commit pushing the changes will be verified using GPG key. contracts-docs-publish: name: Publish contracts documentation - needs: docs-detect-changes - # TODO: remove last OR - if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')) || github.ref == 'refs/pull/3534/merge' + needs: [docs-detect-changes, contracts-docs-prepublish-wait] uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main with: projectDir: /solidity/ecdsa diff --git a/.github/workflows/contracts-random-beacon-docs.yml b/.github/workflows/contracts-random-beacon-docs.yml index f511cee951..5b72569c26 100644 --- a/.github/workflows/contracts-random-beacon-docs.yml +++ b/.github/workflows/contracts-random-beacon-docs.yml @@ -49,6 +49,25 @@ jobs: commentPR: true exportAsGHArtifacts: true + # This job is needed to avoid a clash of `contracts-docs-publish` jobs for + # `random-beacon` and `ecdsa` projects (if both are run and pull the code at + # the same time and try to push to the same branch, one of them will fail). + contracts-docs-prepublish-wait: + name: Wait for contracts docs to be published + needs: contracts-docs-publish-preview + # TODO: remove last OR + if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')) || github.ref == 'refs/pull/3534/merge' + runs-on: ubuntu-latest + steps: + - name: Wait for `random-beacon` docs to be published + uses: lewagon/wait-on-check-action@v1.3.1 + with: + ref: ${{ github.ref }} + check-name: 'Publish contracts documentation' + repo-token: ${{ secrets.GITHUB_TOKEN }} + # 120s is a value for testing purposes. TODO: change to 10s + wait-interval: 120 + # This job will be triggered for releases which name starts with # `refs/tags/solidity/`. It will generate contracts documentation in # Markdown and sync it with a specific path of @@ -57,7 +76,7 @@ jobs: # commit pushing the changes will be verified using GPG key. contracts-docs-publish: name: Publish contracts documentation - needs: docs-detect-changes + needs: [docs-detect-changes, contracts-docs-prepublish-wait] # TODO: remove last OR if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')) || github.ref == 'refs/pull/3534/merge' uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main