[CVAT] Adapt exchange/recording oracles for honeypots #516
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy CVAT Exchange Oracle | |
on: | |
push: | |
branches: [ develop, main, cvat-milestone-2 ] | |
paths: | |
- 'packages/examples/cvat/exchange-oracle/**' | |
pull_request: | |
branches: [ develop, main, cvat-milestone-2 ] | |
paths: | |
- 'packages/examples/cvat/exchange-oracle/**' | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
pull-request-check: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: PR check | |
run: | | |
if [[ $GITHUB_REPOSITORY_OWNER == 'humanprotocol' ]] && [[ $GITHUB_BASE_REF == 'main' ]] && [[ $GITHUB_HEAD_REF == 'develop' ]]; then | |
echo "LGTM. PR from $GITHUB_HEAD_REF to $GITHUB_BASE_REF." | |
elif [[ $GITHUB_BASE_REF != 'main' ]]; then | |
echo "LGTM. PR from $GITHUB_HEAD_REF to $GITHUB_BASE_REF." | |
else | |
echo "Check out the target branch. A PR to 'main' can only be from the 'develop' branch within the 'humanprotocol' organization." | |
exit 1 | |
fi | |
trigger-build-and-deploy: | |
if: always() && github.repository_owner == 'humanprotocol' && (needs.pull-request-check.result == 'skipped' || needs.pull-request-check.result == 'success') | |
needs: pull-request-check | |
name: Trigger build and deploy image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: convictional/[email protected] | |
with: | |
owner: humanprotocol | |
repo: multi-repo-cicd | |
github_token: ${{ secrets.GH_TOKEN }} | |
workflow_file_name: docker_build_and_deploy.yml | |
ref: oracles | |
wait_interval: 15 | |
client_payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "repository": "${{ github.repository }}", "trigger": "${{ github.event_name }}", "app": "exchange-oracle"}' | |
propagate_failure: true | |
trigger_workflow: true | |
wait_workflow: true |