Skip to content
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

90 deploy svelte and angular apps #93

Merged
merged 4 commits into from
Nov 23, 2023
Merged
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
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