Skip to content

Commit

Permalink
feat: Add pages deployment variable logic and fixes in github pages y…
Browse files Browse the repository at this point in the history
…aml files (#1337)
  • Loading branch information
Hristo313 authored Nov 21, 2024
1 parent 412a2a5 commit c75d9c7
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 29 deletions.
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "igniteui-cli",
"version": "14.2.3",
"version": "14.2.4-beta.0",
"description": "CLI tool for creating Ignite UI projects",
"keywords": [
"CLI",
Expand Down Expand Up @@ -78,8 +78,8 @@
"all": true
},
"dependencies": {
"@igniteui/angular-templates": "~18.2.1423",
"@igniteui/cli-core": "~14.2.3",
"@igniteui/angular-templates": "~18.2.1424-beta.0",
"@igniteui/cli-core": "~14.2.4-beta.0",
"@inquirer/prompts": "^5.4.0",
"@types/yargs": "^17.0.33",
"chalk": "^5.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ on:

jobs:
build-and-deploy:
# Deactivate the workflow. Will be changed when AB is ready
if: false
if: $(yamlGenerateDeploymentScript) == true
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

strategy:
matrix:
node-version: [22.x]
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/templates/react/igr-ts/projects/_base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export class BaseIgrTsProject implements ProjectTemplate {
"dot": ".",
"path": name,
"projectTemplate": this.id,
"yamlDefaultBranch": this.id === "base" ? "<%=yaml-default-branch%>" : "main"
"yamlDefaultBranch": this.id === "base" ? "<%=yaml-default-branch%>" : "main",
"yamlGenerateDeploymentScript": "<%=yaml-generate-deployment-script%>"
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ on:

jobs:
build-and-deploy:
# Deactivate the workflow. Will be changed when AB is ready
if: false
if: $(yamlGenerateDeploymentScript) == true
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

strategy:
matrix:
node-version: [22.x]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export class BaseIgcProject implements ProjectTemplate {
dot: ".",
path: name,
projectTemplate: this.id,
yamlDefaultBranch: this.id === "base" ? "<%=yaml-default-branch%>" : "main"
yamlDefaultBranch: this.id === "base" ? "<%=yaml-default-branch%>" : "main",
yamlGenerateDeploymentScript: "<%=yaml-generate-deployment-script%>"
};

return config;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igniteui/cli-core",
"version": "14.2.3",
"version": "14.2.4-beta.0",
"description": "Base types and functionality for Ignite UI CLI",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/update/Update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function updatePackageJsonFiles(
function updateWorkflows(
fs: IFileSystem
): void {
const workflowFiles = ["node.js.yml", "github.io.yml"];
const workflowFiles = ["node.js.yml", "github-pages.yml"];
const oldNpmInstall = "- run: npm i # replace with 'npm ci' after committing lock file from first install";
const newNpmInstall =
`- run: echo "@infragistics:registry=https://packages.infragistics.com/npm/js-licensed/" >> ~/.npmrc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ on:

jobs:
build-and-deploy:
# Deactivate the workflow. Will be changed when AB is ready
if: false
if: <%=yamlGenerateDeploymentScript%> == true
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

strategy:
matrix:
node-version: [22.x]
Expand Down
3 changes: 2 additions & 1 deletion packages/igx-templates/igx-ts-legacy/projects/_base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ $app-palette: palette($primary, $secondary, $surface);
path: name,
projectTemplate: this.id,
yamlDefaultBranch: "<%=yaml-default-branch%>", // the placeholder will be evaluated by CodeGen
ApplicationTitle: "<%=ApplicationTitle%>" // the placeholder will be evaluated by CodeGen
ApplicationTitle: "<%=ApplicationTitle%>", // the placeholder will be evaluated by CodeGen
yamlGenerateDeploymentScript: "<%=yaml-generate-deployment-script%>" // the placeholder will be evaluated by CodeGen
};

switch (theme) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ on:

jobs:
build-and-deploy:
# Deactivate the workflow. Will be changed when AB is ready
if: false
if: <%=yamlGenerateDeploymentScript%> == true
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

strategy:
matrix:
node-version: [22.x]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ on:

jobs:
build-and-deploy:
# Deactivate the workflow. Will be changed when AB is ready
if: false
if: <%=yamlGenerateDeploymentScript%> == true
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

strategy:
matrix:
node-version: [22.x]
Expand Down
3 changes: 2 additions & 1 deletion packages/igx-templates/igx-ts/projects/_base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ $app-palette: palette($primary, $secondary, $surface);
projectTemplate: this.id,
igxPackage: NPM_ANGULAR,
yamlDefaultBranch: "<%=yaml-default-branch%>", // the placeholder will be evaluated by CodeGen
ApplicationTitle: "<%=ApplicationTitle%>" // the placeholder will be evaluated by CodeGen
ApplicationTitle: "<%=ApplicationTitle%>", // the placeholder will be evaluated by CodeGen
yamlGenerateDeploymentScript: "<%=yaml-generate-deployment-script%>" // the placeholder will be evaluated by CodeGen
};

switch (theme) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ on:

jobs:
build-and-deploy:
# Deactivate the workflow. Will be changed when AB is ready
if: false
if: <%=yamlGenerateDeploymentScript%> == true
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

strategy:
matrix:
node-version: [22.x]
Expand Down
4 changes: 2 additions & 2 deletions packages/igx-templates/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igniteui/angular-templates",
"version": "18.2.1423",
"version": "18.2.1424-beta.0",
"description": "Templates for Ignite UI for Angular projects and components",
"repository": {
"type": "git",
Expand All @@ -12,7 +12,7 @@
"author": "Infragistics",
"license": "MIT",
"dependencies": {
"@igniteui/cli-core": "~14.2.3",
"@igniteui/cli-core": "~14.2.4-beta.0",
"typescript": "~5.5.4"
}
}
6 changes: 3 additions & 3 deletions packages/ng-schematics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@igniteui/angular-schematics",
"version": "18.2.1423",
"version": "18.2.1424-beta.0",
"description": "Ignite UI for Angular Schematics for ng new and ng generate",
"repository": {
"type": "git",
Expand All @@ -20,8 +20,8 @@
"dependencies": {
"@angular-devkit/core": "^18.2.4",
"@angular-devkit/schematics": "^18.2.4",
"@igniteui/angular-templates": "~18.2.1423",
"@igniteui/cli-core": "~14.2.3",
"@igniteui/angular-templates": "~18.2.1424-beta.0",
"@igniteui/cli-core": "~14.2.4-beta.0",
"@schematics/angular": "~14.0.0",
"rxjs": "^7.8.1"
},
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/update-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ title = 'igniteui-angular example';
# end content
`},
{
path: ".github/workflows/github.io.yml",
path: ".github/workflows/github-pages.yml",
content:
`# start content
- run: npm i # replace with 'npm ci' after committing lock file from first install
Expand Down Expand Up @@ -596,7 +596,7 @@ export default function Home() {
# end content
`},
{
path: ".github/workflows/github.io.yml",
path: ".github/workflows/github-pages.yml",
content:
`# start content
- run: npm i # replace with 'npm ci' after committing lock file from first install
Expand Down Expand Up @@ -890,7 +890,7 @@ export default class App extends LitElement {
# end content
`},
{
path: ".github/workflows/github.io.yml",
path: ".github/workflows/github-pages.yml",
content:
`# start content
- run: npm i # replace with 'npm ci' after committing lock file from first install
Expand Down

0 comments on commit c75d9c7

Please sign in to comment.