-
Notifications
You must be signed in to change notification settings - Fork 22
Adding CD matrix ymls #3773
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
Adding CD matrix ymls #3773
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d3eefb0
fix(cd): resolving issue with env var
ChronosSF f0f5c48
chore(cd): try with official actions
ChronosSF 7ab6952
chore(cd): try v8 with proper node
ChronosSF a549466
chore(cd): add fallback and check
ChronosSF f57a971
feat(cd): add deployment info artifact
ChronosSF b277d2b
feat(*): adding artifact dl info
ChronosSF 378cbdc
feat(matrix): using matrix strategy for templated run
ChronosSF ecd4995
Merge branch 'vnext' into sstoychev/cd-trigger-yml
ChronosSF f8c7006
Potential fix for code scanning alert no. 8: Workflow does not contai…
ChronosSF 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,213 @@ | ||
| name: Continuous Deployment Matrix | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - vnext | ||
| workflow_dispatch: | ||
| workflow_dispatch: | ||
| inputs: | ||
| branch: | ||
| description: 'Input a branch name (e.g., vnext)' | ||
| required: true | ||
|
|
||
| env: | ||
| REPLACEMENT_TEXT: '@infragistics/igniteui-angular-extras' | ||
| BRANCH_REF: ${{ github.event.inputs.branch && format('refs/heads/{0}', github.event.inputs.branch) || github.ref }} | ||
|
|
||
| jobs: | ||
| build-and-deploy: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - name: app | ||
| custom_command: run generate-live-editing | ||
| submodule_dir: angular-demos | ||
| base_href: /angular-demos/ | ||
| target_folder: dist/app | ||
| npm_build_command: run build-ci | ||
| repositoryfy: true | ||
| repositoryfy_command: repositoryfyAngularDemos | ||
| - name: app-crm | ||
| custom_command: run generate-live-editing:app-crm | ||
| submodule_dir: angular-demos-crm | ||
| base_href: /angular-demos-grid-crm/ | ||
| target_folder: dist/app-crm | ||
| npm_build_command: run build-ci:app-crm --loglevel verbose | ||
| repositoryfy: false | ||
| repositoryfy_command: '' | ||
| - name: app-lob | ||
| custom_command: run generate-live-editing:app-lob | ||
| submodule_dir: angular-demos-lob | ||
| base_href: /angular-demos-lob/ | ||
| target_folder: dist/app-lob | ||
| npm_build_command: run build-ci:app-lob | ||
| repositoryfy: true | ||
| repositoryfy_command: repositoryfyAngularDemosLob | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22.x' | ||
|
|
||
| - name: Replace with licensed angular-extras | ||
| shell: pwsh | ||
| run: | | ||
| # List of files to update | ||
| $files = @( | ||
| "projects/app-lob/src/app/grid-dynamic-chart-data/grid-dynamic-chart-data.component.ts", | ||
| "projects/app-lob/src/app/grid-dynamic-chart-data/data-analysis-dock-manager/data-analysis-dock-manager.component.ts", | ||
| "package.json") | ||
| foreach ($file in $files) { | ||
| if (Test-Path $file) { | ||
| (Get-Content -Path $file) -replace 'igniteui-angular-extras', '${{ env.REPLACEMENT_TEXT }}' | Set-Content -Path $file | ||
| } | ||
| } | ||
|
|
||
| - name: Create .npmrc file | ||
| run: touch .npmrc | ||
|
|
||
| - name: Configure npm registry | ||
| run: | | ||
| echo "@infragistics:registry=https://packages.infragistics.com/npm/js-licensed/" >> .npmrc | ||
| echo "//packages.infragistics.com/npm/js-licensed/:_authToken=${{ secrets.INFRAGISTICS_NPM_TOKEN }}" >> .npmrc | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
| env: | ||
| GITHUB_ACTIONS: true | ||
|
|
||
| - name: Clone submodule | ||
| run: git clone --recurse-submodules https://github.com/IgniteUI/igniteui-live-editing-samples igniteui-live-editing-samples | ||
|
|
||
| - name: Checkout branch in submodule (vNext) | ||
| if: env.BRANCH_REF == 'refs/heads/vnext' | ||
| run: | | ||
| cd igniteui-live-editing-samples | ||
| git checkout vNext | ||
|
|
||
| - name: Checkout branch in submodule (master) | ||
| if: env.BRANCH_REF == 'refs/heads/master' | ||
| run: | | ||
| cd igniteui-live-editing-samples | ||
| git checkout master | ||
|
|
||
| - name: Update package.json with base href | ||
| run: | | ||
| sed -i 's/--configuration production/--base-href=${{ matrix.base_href }} --configuration production/g' package.json | ||
|
|
||
| - name: Generate live-editing | ||
| run: npm ${{ matrix.custom_command }} | ||
|
|
||
| - name: Update packages trial->licensed using angular schematics | ||
| run: | | ||
| npx --userconfig=./.npmrc ng g @igniteui/angular-schematics:upgrade-packages --skip-install | ||
|
|
||
| - name: Install dependencies after schematics | ||
| run: npm install | ||
| env: | ||
| GITHUB_ACTIONS: true | ||
|
|
||
| - name: Build application | ||
| run: npm ${{ matrix.npm_build_command }} --userconfig=./.npmrc | ||
|
|
||
| - name: Copy web.config | ||
| run: | | ||
| if [ -f "projects/app-crm/web.config" ]; then | ||
| cp projects/app-crm/web.config ${{ matrix.target_folder }}/browser/ | ||
| fi | ||
|
|
||
| - name: Update web.config file | ||
| run: | | ||
| if [ -f "${{ matrix.target_folder }}/browser/web.config" ]; then | ||
| sed -i 's/angular-demos/${{ matrix.submodule_dir }}/g' ${{ matrix.target_folder }}/browser/web.config | ||
| fi | ||
|
|
||
| - name: Rename index.csr.html to index.html | ||
| run: | | ||
| if [ -f "${{ matrix.target_folder }}/browser/index.csr.html" ]; then | ||
| mv "${{ matrix.target_folder }}/browser/index.csr.html" "${{ matrix.target_folder }}/browser/index.html" | ||
| echo "File renamed successfully." | ||
| fi | ||
|
|
||
| - name: Create zip artifact | ||
| run: | | ||
| cd ${{ matrix.target_folder }}/browser | ||
| zip -r ../../${{ matrix.submodule_dir }}-artifact.zip ./ | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.submodule_dir }}-artifact | ||
| path: ${{ matrix.submodule_dir }}-artifact.zip | ||
|
|
||
| - name: Repositorify (vNext) | ||
| if: env.BRANCH_REF == 'refs/heads/vnext' && matrix.repositoryfy == true | ||
| run: npm run ${{ matrix.repositoryfy_command }} | ||
|
|
||
| - name: Repositorify (Production) | ||
| if: env.BRANCH_REF == 'refs/heads/master' && matrix.repositoryfy == true | ||
| run: npm run ${{ matrix.repositoryfy_command }}:prod | ||
|
|
||
| - name: Stage changes | ||
| if: matrix.repositoryfy == true | ||
| run: | | ||
| cd igniteui-live-editing-samples/${{ matrix.submodule_dir }} | ||
| git add . | ||
|
|
||
| - name: Check for changes | ||
| if: matrix.repositoryfy == true | ||
| id: check_changes | ||
| run: | | ||
| cd igniteui-live-editing-samples/${{ matrix.submodule_dir }} | ||
| if [ -n "$(git status --porcelain)" ]; then | ||
| echo "changes_detected=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "changes_detected=false" >> $GITHUB_OUTPUT | ||
| echo "No changes to commit." | ||
| fi | ||
|
|
||
| - name: Configure git and commit changes | ||
| if: matrix.repositoryfy == true && steps.check_changes.outputs.changes_detected == 'true' | ||
| run: | | ||
| cd igniteui-live-editing-samples/${{ matrix.submodule_dir }} | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
| git commit -m "Automated repository update" | ||
|
|
||
| - name: Push changes | ||
| if: matrix.repositoryfy == true && steps.check_changes.outputs.changes_detected == 'true' | ||
| run: | | ||
| cd igniteui-live-editing-samples/${{ matrix.submodule_dir }} | ||
| git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/IgniteUI/igniteui-live-editing-samples.git | ||
| continue-on-error: true | ||
|
|
||
| - name: Trigger Deploy Workflow in IgniteUI Actions | ||
| uses: actions/github-script@v8 | ||
| with: | ||
| github-token: ${{ secrets.CLASSIC_PATKA }} | ||
| script: | | ||
| await github.rest.repos.createDispatchEvent({ | ||
| owner: 'IgniteUI', | ||
| repo: 'igniteui-actions', | ||
| event_type: 'igniteui-angular-samples-cd', | ||
| client_payload: { | ||
| repository: "${{ github.repository }}", | ||
| run_id: "${{ github.run_id }}", | ||
| artifact_name: "${{ matrix.submodule_dir }}-artifact", | ||
| ref: "${{ github.ref }}", | ||
| sha: "${{ github.sha }}", | ||
| branch: '${{ github.ref_name }}', | ||
| unit: false, | ||
| integration: true | ||
| } | ||
| }); | ||
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
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.