Skip to content

Commit

Permalink
90 deploy svelte and angular apps (#93)
Browse files Browse the repository at this point in the history
* feat: deploy svelte and angular apps

* feat: deploy svelte and angular apps

* fix: angular build
  • Loading branch information
davidecarpini authored Nov 23, 2023
1 parent 8141127 commit 88b147b
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 55 deletions.
91 changes: 46 additions & 45 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,64 @@
name: Deploy static content to Pages

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


# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 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
packages: write
contents: read
pages: write
id-token: write
packages: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
group: 'pages'
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node v16 & GitHub registry
uses: actions/setup-node@v3
with:
node-version: 18
- name: Use Node v16 & GitHub registry
uses: actions/setup-node@v3
with:
node-version: 18

- name: Build React App
run: |
yarn install:all
yarn build
- name: Build React App
run: |
yarn install:all
yarn build
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Setup Pages
uses: actions/configure-pages@v2

- name: Copy Builds
run: |
mkdir build
cp -r apps/sample-vue-app/dist build/vue
cp -r apps/sample-react-app/build build/react
cp -r apps/sample-vanilla-app/dist build/vanilla
- name: Copy Builds
run: |
mkdir build
cp -r apps/sample-vue-app/dist build/vue
cp -r apps/sample-react-app/build build/react
cp -r apps/sample-vanilla-app/dist build/vanilla
cp -r apps/sample-svelte-app/dist build/svelte
cp -r apps/sample-angular-app/dist/easy-angular build/angular
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload build
path: './build'
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload build
path: './build'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
3 changes: 1 addition & 2 deletions apps/sample-angular-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
"private": true,
"scripts": {
"add-page": "ng g m pages/page-name --routing && ng g component pages/page-name --skip-tests",
"build": "ng build --configuration development",
"dev": "ng serve",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
"ng": "ng",
"test": "ng test",
"watch": "ng build --watch --configuration development"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions apps/sample-svelte-app/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ node_modules
pnpm-lock.yaml
package-lock.json
yarn.lock
.eslintrc.cjs
8 changes: 8 additions & 0 deletions apps/sample-svelte-app/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const Config = require('@vechain/repo-config');

module.exports = {
...Config.EslintLibrary,
rules: {
'no-constant-binary-expression': 'off',
},
};
1 change: 1 addition & 0 deletions apps/sample-svelte-app/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.eslintrc.js
9 changes: 4 additions & 5 deletions apps/sample-svelte-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite dev"
"dev": "vite dev",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@vechainfoundation/dapp-kit-ui": "*",
"lru-cache": "5.1.1",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0"
"@vechainfoundation/dapp-kit-ui": "*"
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.27.4",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
Expand Down
1 change: 1 addition & 0 deletions apps/sample-svelte-app/src/routes/+layout.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const ssr = false;
export const prerender = true;
12 changes: 10 additions & 2 deletions apps/sample-svelte-app/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';

/** @type {import('@sveltejs/kit').Config} */
Expand All @@ -11,7 +11,15 @@ const config = {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter(),
adapter: adapter({
// default options are shown. On some platforms
// these options are set automatically — see below
pages: 'dist',
assets: 'dist',
fallback: undefined,
precompress: true,
strict: true,
}),
},
};

Expand Down
2 changes: 1 addition & 1 deletion apps/sample-svelte-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
"moduleResolution": "node"
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
Expand Down

0 comments on commit 88b147b

Please sign in to comment.