-
Notifications
You must be signed in to change notification settings - Fork 323
OPDATA-3845: Trigger 'deploy' workflow from release PR #4143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
34bb2b0
copy .github/workflows/deploy.yml
dskloetc 5fff19f
Trigger 'deploy' workflow from release PR
dskloetc 47659e1
Potential fix for code scanning alert no. 58: Workflow does not conta…
dskloetc e3a46ab
Merge branch 'main' into kloet/deploy-from-release-pr
app-token-issuer-data-feeds[bot] 0efa793
Merge branch 'main' into kloet/deploy-from-release-pr
app-token-issuer-data-feeds[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # This workflow is triggered by PRs that propose a release. It publishes docker | ||
| # images and deploys them to infra-k8s for the adapters proposed to release. | ||
| # | ||
| # Because building and deploying are only allowed from a protected branch, and | ||
| # this workflow is triggered by pull requests, it dispatches to another | ||
| # workflow to do the actual work. | ||
| name: Deploy | ||
|
|
||
| on: | ||
dskloetc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| pull_request: | ||
| branches: | ||
| - main | ||
| # The only commits that will contain changes to the masterlist will be releases | ||
| paths: | ||
| - 'MASTERLIST.md' | ||
|
|
||
| concurrency: | ||
| group: deploy-and-release | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| calculate-changes: | ||
| name: Compute changed adapters | ||
| permissions: | ||
| contents: read | ||
| runs-on: [ubuntu-latest] | ||
| outputs: | ||
| adapter-list: ${{ steps.changed-adapters.outputs.CHANGED_ADAPTERS }} | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 2 | ||
| - name: Build list of changed packages and changed adapters | ||
| id: changed-adapters | ||
| env: | ||
| UPSTREAM_BRANCH: HEAD~1 | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| ./.github/scripts/changed-adapters.sh | ||
| disaptch: | ||
| name: Trigger the deploy workflow | ||
| permissions: | ||
| contents: read | ||
| actions: write | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - calculate-changes | ||
| if: needs.calculate-changes.outputs.adapter-list != '[]' | ||
| env: | ||
| CHANGED_ADAPTERS: ${{ needs.calculate-changes.outputs.adapter-list }} | ||
| PR_BRANCH_NAME: ${{ github.event.pull_request.head.ref }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Determine infra-k8s branch name suffix | ||
| id: suffix | ||
| run: | | ||
| # If the branch name is 'changeset-release/main', then this is the | ||
| # PR to release all changed adapters so we don't use a suffix. | ||
| if [[ "$PR_BRANCH_NAME" = "changeset-release/main" ]]; then | ||
| echo "SUFFIX=" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "SUFFIX=-pr${{ github.event.number }}" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Trigger deploy workflow | ||
| run: > | ||
| gh workflow run "Deploy" | ||
| --ref main | ||
| -F adapters="$(echo $CHANGED_ADAPTERS | jq -r "(.adapter | .[].shortName)" | tr '\n' ',')" | ||
| -F infra-k8s-branch-suffix="${{ steps.suffix.outputs.SUFFIX }}" | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.