mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 23:08:04 -05:00
chore - Make enterprise preview work when labeled after the fact (#10862)
This commit is contained in:
29
.github/workflows/enterprise-preview.yml
vendored
Normal file
29
.github/workflows/enterprise-preview.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Feature branch preview for enterprise code
|
||||||
|
name: Enterprise Preview
|
||||||
|
|
||||||
|
# Run on PRs labeled
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [labeled]
|
||||||
|
|
||||||
|
# Match ghcr-build.yml, but don't interrupt it.
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# This must happen for the PR Docker workflow when the label is present,
|
||||||
|
# and also if it's added after the fact. Thus, it exists in both places.
|
||||||
|
enterprise-preview:
|
||||||
|
name: Enterprise preview
|
||||||
|
if: github.event.label.name == 'deploy'
|
||||||
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||||
|
steps:
|
||||||
|
# This should match the version in ghcr-build.yml
|
||||||
|
- name: Trigger remote job
|
||||||
|
run: |
|
||||||
|
curl --fail-with-body -sS -X POST \
|
||||||
|
-H "Authorization: Bearer ${{ secrets.PAT_TOKEN }}" \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-d "{\"ref\": \"main\", \"inputs\": {\"openhandsPrNumber\": \"${{ github.event.pull_request.number }}\", \"deployEnvironment\": \"feature\", \"enterpriseImageTag\": \"pr-${{ github.event.pull_request.number }}\" }}" \
|
||||||
|
https://api.github.com/repos/All-Hands-AI/deploy/actions/workflows/deploy.yaml/dispatches
|
||||||
5
.github/workflows/ghcr-build.yml
vendored
5
.github/workflows/ghcr-build.yml
vendored
@@ -235,12 +235,11 @@ jobs:
|
|||||||
|
|
||||||
enterprise-preview:
|
enterprise-preview:
|
||||||
name: Enterprise preview
|
name: Enterprise preview
|
||||||
if: |
|
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')
|
||||||
(github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'deploy') ||
|
|
||||||
(github.event_name == 'pull_request' && github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'deploy'))
|
|
||||||
runs-on: blacksmith-4vcpu-ubuntu-2204
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
||||||
needs: [ghcr_build_enterprise]
|
needs: [ghcr_build_enterprise]
|
||||||
steps:
|
steps:
|
||||||
|
# This should match the version in enterprise-preview.yml
|
||||||
- name: Trigger remote job
|
- name: Trigger remote job
|
||||||
run: |
|
run: |
|
||||||
curl --fail-with-body -sS -X POST \
|
curl --fail-with-body -sS -X POST \
|
||||||
|
|||||||
Reference in New Issue
Block a user