@beeblock/svelar 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,7 @@ export declare class DeployTemplates {
|
|
|
8
8
|
static composeDevOverride(): string;
|
|
9
9
|
static composeProdOverride(image: string): string;
|
|
10
10
|
static healthEndpoint(): string;
|
|
11
|
-
static githubActionsWorkflow(
|
|
11
|
+
static githubActionsWorkflow(): string;
|
|
12
12
|
static setupDropletScript(appName: string): string;
|
|
13
13
|
static dropletEnvExample(appName: string): string;
|
|
14
14
|
}
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* make:ci — Generate GitHub Actions CI/CD workflow.
|
|
3
|
+
*
|
|
4
|
+
* All values come from GitHub Secrets — nothing is hardcoded in the
|
|
5
|
+
* generated workflow file.
|
|
3
6
|
*/
|
|
4
7
|
import { Command } from '../Command.js';
|
|
5
8
|
export declare class MakeCiCommand extends Command {
|
|
6
9
|
name: string;
|
|
7
10
|
description: string;
|
|
8
11
|
arguments: never[];
|
|
9
|
-
flags:
|
|
10
|
-
name: string;
|
|
11
|
-
alias: string;
|
|
12
|
-
description: string;
|
|
13
|
-
type: "string";
|
|
14
|
-
} | {
|
|
15
|
-
name: string;
|
|
16
|
-
description: string;
|
|
17
|
-
type: "string";
|
|
18
|
-
alias?: undefined;
|
|
19
|
-
} | {
|
|
12
|
+
flags: {
|
|
20
13
|
name: string;
|
|
21
14
|
alias: string;
|
|
22
15
|
description: string;
|
|
23
16
|
type: "boolean";
|
|
24
|
-
}
|
|
17
|
+
}[];
|
|
25
18
|
handle(_args: string[], flags: Record<string, any>): Promise<void>;
|
|
26
|
-
private resolveAppName;
|
|
27
19
|
}
|
package/dist/cli/index.js
CHANGED
|
@@ -930,16 +930,18 @@ export const GET = () => json({
|
|
|
930
930
|
timestamp: new Date().toISOString(),
|
|
931
931
|
uptime: process.uptime(),
|
|
932
932
|
});
|
|
933
|
-
`}static githubActionsWorkflow(
|
|
933
|
+
`}static githubActionsWorkflow(){return`# \u2500\u2500 Svelar CI/CD \u2014 Build, Push & Deploy \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
934
934
|
# Builds on push and PR to main. Deploys only on push.
|
|
935
935
|
#
|
|
936
936
|
# Required GitHub Secrets:
|
|
937
|
-
# DOCKER_USERNAME
|
|
938
|
-
# DOCKER_TOKEN
|
|
939
|
-
#
|
|
940
|
-
#
|
|
941
|
-
#
|
|
942
|
-
#
|
|
937
|
+
# DOCKER_USERNAME \u2014 Docker Hub username
|
|
938
|
+
# DOCKER_TOKEN \u2014 Docker Hub access token
|
|
939
|
+
# DOCKER_IMAGE_NAME \u2014 Docker image name (e.g. myapp)
|
|
940
|
+
# DROPLET_HOST \u2014 Droplet IP or hostname
|
|
941
|
+
# DROPLET_USER \u2014 SSH user on the droplet (e.g. deploy)
|
|
942
|
+
# DROPLET_SSH_KEY \u2014 Private SSH key for the deploy user
|
|
943
|
+
# DROPLET_PROJECT \u2014 Project directory name on the droplet (e.g. myapp)
|
|
944
|
+
# ENV_PROD \u2014 Complete production .env file contents
|
|
943
945
|
#
|
|
944
946
|
# Generated by: npx svelar make:ci
|
|
945
947
|
|
|
@@ -952,7 +954,7 @@ on:
|
|
|
952
954
|
branches: [main]
|
|
953
955
|
|
|
954
956
|
env:
|
|
955
|
-
DOCKER_IMAGE: \${{ secrets.DOCKER_USERNAME }}
|
|
957
|
+
DOCKER_IMAGE: \${{ secrets.DOCKER_USERNAME }}/\${{ secrets.DOCKER_IMAGE_NAME }}
|
|
956
958
|
|
|
957
959
|
jobs:
|
|
958
960
|
build-and-deploy:
|
|
@@ -995,7 +997,7 @@ jobs:
|
|
|
995
997
|
key: \${{ secrets.DROPLET_SSH_KEY }}
|
|
996
998
|
script: |
|
|
997
999
|
echo "\${{ secrets.DOCKER_TOKEN }}" | docker login -u "\${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
|
998
|
-
cd
|
|
1000
|
+
cd \${{ secrets.DROPLET_PROJECT }}/
|
|
999
1001
|
echo "\${{ secrets.ENV_PROD }}" > .env
|
|
1000
1002
|
docker compose -f docker-compose.yml -f docker-compose.prod.yml pull
|
|
1001
1003
|
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
|