Skip to content
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
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist
templates
boilerplate
boilerplate/functions
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
- name: Deploy to Juno
uses: junobuild/juno-action@main
with:
args: deploy
args: hosting deploy
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Serverless Functions
on:
workflow_dispatch:
release:
types: [ released ]
types: [released]

jobs:
publish:
Expand All @@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: npm ci
Expand All @@ -30,4 +30,4 @@ jobs:
with:
args: functions publish
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
32 changes: 32 additions & 0 deletions boilerplate/github/pnpm/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy to Juno

on:
workflow_dispatch:
push:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/action-setup@v4
with:
version: 10

- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Deploy to Juno
uses: junobuild/juno-action@main
with:
args: hosting deploy
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
37 changes: 37 additions & 0 deletions boilerplate/github/pnpm/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Serverless Functions

on:
workflow_dispatch:
release:
types: [released]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/action-setup@v4
with:
version: 10

- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Build
uses: junobuild/juno-action@full
with:
args: functions build

- name: Publish
uses: junobuild/juno-action@full
with:
args: functions publish
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
34 changes: 34 additions & 0 deletions boilerplate/github/yarn/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy to Juno

on:
workflow_dispatch:
push:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'

- name: Enable Corepack
run: corepack enable

- name: Activate Yarn
run: corepack prepare yarn@1.x --activate

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Deploy to Juno
uses: junobuild/juno-action@main
with:
args: hosting deploy
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
39 changes: 39 additions & 0 deletions boilerplate/github/yarn/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Serverless Functions

on:
workflow_dispatch:
release:
types: [released]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'

- name: Enable Corepack
run: corepack enable

- name: Activate Yarn
run: corepack prepare yarn@1.x --activate

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Build
uses: junobuild/juno-action@full
with:
args: functions build

- name: Publish
uses: junobuild/juno-action@full
with:
args: functions publish
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
8 changes: 4 additions & 4 deletions src/services/generate.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
getLocalTemplatePath,
getRelativeTemplatePath
} from '../utils/fs.utils';
import {whichPMRuns} from '../utils/pm.utils';
import {createDirectory, getLocalFiles, type LocalFileDescriptor} from '../utils/populate.utils';

export const generate = async ({gitHubAction, serverlessFunctions, ...rest}: PopulateInput) => {
Expand Down Expand Up @@ -133,15 +134,14 @@ const populateGitHubAction = async ({

createFolders(target);

if (isNullish(serverlessFunctions)) {
const source = join(BOILERPLATE_PATH, 'github');
const pm = whichPMRuns();
const source = join(BOILERPLATE_PATH, 'github', pm);

if (isNullish(serverlessFunctions)) {
await copyFile({source, target, file: 'deploy.yml'});
return;
}

const source = join(BOILERPLATE_PATH, 'github');

await copyFiles({source, target});
};

Expand Down