Skip to content

Commit

Permalink
Add deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepyfran committed Oct 22, 2024
1 parent dc3f4d5 commit 85eebeb
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 29 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Echo

on:
push:
branches: ["main"]

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 22
cache: "yarn"
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
env:
VITE_CLIENT_ID: ${{ secrets.VITE_CLIENT_ID }}
VITE_CLIENT_SECRET: ${{ secrets.VITE_CLIENT_SECRET }}
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: "./dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
65 changes: 36 additions & 29 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,45 @@
import { defineConfig } from "vite";
import fs from "fs";

export default defineConfig({
build: {
outDir: "../../dist",
rollupOptions: {
output: {
manualChunks: (id) => {
if (
id.includes("node_modules/music-metadata") ||
id.includes("node_modules/buffer")
) {
return "vendor-music-metadata";
}
export default defineConfig(({ command }) => {
const serverOptions =
command == "serve"
? {
https: {
key: fs.readFileSync("./tools/certificates/key.pem"),
cert: fs.readFileSync("./tools/certificates/cert.pem"),
},
port: 4443,
}
: {};

if (
id.includes("node_modules/effect") ||
id.includes("node_modules/@effect")
) {
return "vendor-effect";
}
return {
build: {
outDir: "../../dist",
rollupOptions: {
output: {
manualChunks: (id) => {
if (
id.includes("node_modules/music-metadata") ||
id.includes("node_modules/buffer")
) {
return "vendor-music-metadata";
}

if (
id.includes("node_modules/effect") ||
id.includes("node_modules/@effect")
) {
return "vendor-effect";
}
},
},
},
},
},
root: "./packages/web",
worker: {
format: "es",
},
server: {
https: {
key: fs.readFileSync("./tools/certificates/key.pem"),
cert: fs.readFileSync("./tools/certificates/cert.pem"),
root: "./packages/web",
worker: {
format: "es",
},
port: 4443,
},
server: serverOptions,
};
});

0 comments on commit 85eebeb

Please sign in to comment.