Skip to content

Commit

Permalink
feat: deploy showcase in github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fpaul-1A committed Oct 26, 2023
1 parent 3b82e7c commit 178a999
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 10 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy-showcase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./tools/github-actions/setup
- name: build
run: yarn nx build showcase
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './apps/showcase/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion apps/showcase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@angular/router": "~16.2.0",
"@design-factory/design-factory": "^15.2.2",
"@formatjs/intl-numberformat": "~8.8.0",
"@ng-bootstrap/ng-bootstrap": "^15.1.1",
"@ngrx/effects": "~16.3.0",
"@ngrx/entity": "~16.3.0",
"@ngrx/store": "~16.3.0",
Expand Down Expand Up @@ -77,7 +78,6 @@
"@angular-eslint/template-parser": "~16.2.0",
"@angular/cli": "~16.2.0",
"@angular/compiler-cli": "~16.2.0",
"@ng-bootstrap/ng-bootstrap": "^15.1.1",
"@nx/eslint-plugin": "~16.10.0",
"@o3r/dev-tools": "workspace:^",
"@o3r/eslint-config-otter": "workspace:^",
Expand Down
16 changes: 9 additions & 7 deletions apps/showcase/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"dependsOn": [
"extract-translations",
"extract-components",
"compile",
"generate-translations"
"generate-translations",
"compile"
]
},
"lint": {
Expand Down Expand Up @@ -104,7 +104,11 @@
"namedChunks": true
}
},
"defaultConfiguration": "production"
"defaultConfiguration": "production",
"dependsOn": [
"^build",
"generate-translations"
]
},
"serve": {
"executor": "@o3r/core:multi-watcher",
Expand Down Expand Up @@ -215,6 +219,7 @@
},
"dependsOn": [
"i18n",
"extract-translations",
"^build-builders"
]
},
Expand All @@ -233,10 +238,7 @@
"extraFilePatterns": [
"src/i18n/*.localization.json"
]
},
"dependsOn": [
"compile"
]
}
},
"run": {
"executor": "@o3r/core:multi-watcher",
Expand Down
2 changes: 1 addition & 1 deletion packages/@o3r/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"cpy-cli": "^4.2.0",
"eslint": "^8.42.0",
"@nx/eslint-plugin": "~16.10.0",
"jsonc-eslint-parser": "~2.3.0",
"jsonc-eslint-parser": "~2.4.0",
"eslint-import-resolver-node": "^0.3.4",
"eslint-plugin-jest": "~27.4.0",
"eslint-plugin-jsdoc": "~46.8.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/@o3r/schematics/schematics/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import * as fs from 'node:fs';
import * as path from 'node:path';
import { lastValueFrom } from 'rxjs';
import type { PackageJson } from 'type-fest';
import { AddDevInstall } from '@o3r/schematics';

/**
* Add Otter schematics to an Angular Project
*/
export function ngAdd(): Rule {
const schematicsDependencies = ['@angular-devkit/architect', '@angular-devkit/schematics', '@angular-devkit/core', '@schematics/angular', 'globby'];
return async (tree: Tree, context: SchematicContext): Promise<Rule> => {
// eslint-disable-next-line @typescript-eslint/naming-convention
const { AddDevInstall } = await import('@o3r/schematics');
context.logger.info('Running ng add for schematics');
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
const treePackageJson = tree.readJson('./package.json') as PackageJson;
Expand Down

0 comments on commit 178a999

Please sign in to comment.