Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 70 additions & 48 deletions .github/workflows/cd-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
name: Continuous Deployment Matrix

# Builds the three sample apps and hands each to IgniteUI/igniteui-actions, which deploys it to
# S3 behind CloudFront: vnext to staging, master to production. A manual run ("Use workflow
# from") builds and deploys the branch it runs on; other branches build but do not deploy.

# The live-editing push uses CLASSIC_PAT_GITHUB and the dispatch a GitHub App token, so the
# workflow's own token only needs to read.
permissions:
contents: write
contents: read

on:
push:
branches:
- master
- vnext
workflow_dispatch:
inputs:
branch:
description: 'Input a branch name (e.g., vnext)'
required: true

# One run per branch at a time, so a branch's pushes deploy in order.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

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:
# One app's failure must not stop the others from deploying.
fail-fast: false
matrix:
include:
- name: app
Expand Down Expand Up @@ -50,14 +59,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
ref: ${{ env.BRANCH_REF }}
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24

Expand Down Expand Up @@ -97,13 +105,13 @@ jobs:
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' }}
if: ${{ github.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' }}
if: ${{ github.ref == 'refs/heads/master' }}
run: |
cd igniteui-live-editing-samples
git checkout master
Expand Down Expand Up @@ -135,43 +143,44 @@ jobs:
GOGC: '50'
NODE_OPTIONS: '--max_old_space_size=4096'

- 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

# No web.config: on S3 the routing (SPA fallback, root redirect) is a CloudFront Function.
- 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
# The deploy deletes from S3 whatever the build no longer has, so a broken build must not
# leave here. igniteui-actions checks it again before it uploads.
- name: Check the build produced the app
env:
SITE: ${{ matrix.target_folder }}/browser
APP: ${{ matrix.base_href }}
run: |
cd ${{ matrix.target_folder }}/browser
zip -r ${{ github.workspace }}/${{ matrix.base_href }}-artifact.zip ./
test -f "$SITE/index.html" || { echo "::error::$SITE/index.html is missing"; exit 1; }
grep -q "<base href=\"/$APP/\"" "$SITE/index.html" || {
echo "::error::$SITE/index.html is not built for /$APP/"; exit 1; }
echo "$(find "$SITE" -type f | wc -l) files"

- name: Upload artifact
uses: actions/upload-artifact@v4
- name: Upload the site
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ matrix.base_href }}-artifact
path: ${{ matrix.base_href }}-artifact.zip
retention-days: 1
name: site-${{ matrix.base_href }}
path: ${{ matrix.target_folder }}/browser
# igniteui-actions downloads it later, possibly after waiting for an earlier deploy.
retention-days: 7
if-no-files-found: error
include-hidden-files: true
# A re-run of this job finds the first attempt's artifact still on the run.
overwrite: true

- name: Repositorify (vNext)
if: ${{ env.BRANCH_REF == 'refs/heads/vnext' && matrix.repositoryfy == true }}
if: ${{ github.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 }}
if: ${{ github.ref == 'refs/heads/master' && matrix.repositoryfy == true }}
run: npm run ${{ matrix.repositoryfy_command }}:prod

- name: Check for changes
Expand Down Expand Up @@ -205,24 +214,37 @@ jobs:
git push https://x-access-token:${{ secrets.CLASSIC_PAT_GITHUB }}@github.com/IgniteUI/igniteui-live-editing-samples.git
continue-on-error: true

- name: Trigger Deploy Workflow in IgniteUI Actions
uses: actions/github-script@v8
# Only vnext (staging) and master (production) deploy. igniteui-actions checks this run
# again (repository, workflow, branch, commit) and decides the S3 folder from the app name.
- name: Get a token for igniteui-actions
if: github.ref == 'refs/heads/vnext' || github.ref == 'refs/heads/master'
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ secrets.IGNITEUI_GITHUB_APP_CLIENT_ID }}
private-key: ${{ secrets.IGNITEUI_GITHUB_APP_PRIVATE_KEY }}
owner: IgniteUI
repositories: igniteui-actions
# A dispatch needs only this; without it the token gets every permission the App has.
permission-contents: write

- name: Start the deploy in IgniteUI/igniteui-actions
if: github.ref == 'refs/heads/vnext' || github.ref == 'refs/heads/master'
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
APP: ${{ matrix.base_href }}
with:
github-token: ${{ secrets.CLASSIC_PAT_GITHUB }}
github-token: ${{ steps.app-token.outputs.token }}
script: |
await github.rest.repos.createDispatchEvent({
owner: 'IgniteUI',
repo: 'igniteui-actions',
event_type: 'igniteui-samples-cd',
event_type: 'igniteui-samples-s3-cd',
client_payload: {
calling_branch: "${{ env.BRANCH_REF }}",
repository: "${{ github.repository }}",
run_id: "${{ github.run_id }}",
artifact_name: "${{ matrix.submodule_dir }}-artifact",
base_href: "${{ matrix.base_href }}",
submodule_dir: "${{ matrix.submodule_dir }}",
ref: "${{ github.ref }}",
sha: "${{ github.sha }}",
branch: '${{ github.ref_name }}',
}
app: process.env.APP,
run_id: String(context.runId),
repository: context.repo.owner + '/' + context.repo.repo,
calling_branch: context.ref,
sha: context.sha,
},
});
96 changes: 0 additions & 96 deletions projects/app-crm/web.config

This file was deleted.

11 changes: 0 additions & 11 deletions projects/app-lob/src/assets/images/svg/web.config

This file was deleted.

11 changes: 0 additions & 11 deletions src/assets/images/svg/web.config

This file was deleted.

Loading