Initial Coolify deployment template
Some checks are pending
Deploy to Coolify / deploy (push) Waiting to run
Some checks are pending
Deploy to Coolify / deploy (push) Waiting to run
This commit is contained in:
commit
24173fe5bb
6 changed files with 146 additions and 0 deletions
2
.env.example
Normal file
2
.env.example
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
COOLIFY_WEBHOOK=https://coolify.example.com/api/v1/deploy?uuid=example&force=false
|
||||
COOLIFY_TOKEN=replace-with-token-that-has-deploy-permission
|
||||
21
.forgejo/workflows/deploy.yml
Normal file
21
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
name: Deploy to Coolify
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Validate required secrets
|
||||
run: |
|
||||
test -n "${{ secrets.COOLIFY_WEBHOOK }}"
|
||||
test -n "${{ secrets.COOLIFY_TOKEN }}"
|
||||
|
||||
- name: Trigger Coolify deployment
|
||||
run: |
|
||||
curl --fail --show-error --request GET "${{ secrets.COOLIFY_WEBHOOK }}" \
|
||||
--header "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}"
|
||||
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
node_modules/
|
||||
dist/
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
5
Dockerfile
Normal file
5
Dockerfile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
FROM nginx:1.27-alpine
|
||||
|
||||
COPY public/ /usr/share/nginx/html/
|
||||
|
||||
EXPOSE 80
|
||||
49
README.md
Normal file
49
README.md
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# Template
|
||||
|
||||
Minimal Forgejo + Coolify deployment template.
|
||||
|
||||
This repository is intended to stay on Forgejo. Coolify should use it as an "Other Git Provider" repository:
|
||||
|
||||
- Public repo: use `http://192.168.1.113:3001/artur/template` as the HTTPS/HTTP repository URL.
|
||||
- Private repo: add a deploy key in Coolify and Forgejo, then use `ssh://git@192.168.1.113:222/artur/template.git`.
|
||||
|
||||
Automatic deployments are handled by Forgejo Actions calling Coolify's Deploy Webhook.
|
||||
|
||||
## Required Forgejo Secrets
|
||||
|
||||
Add these in `Settings -> Actions -> Secrets`:
|
||||
|
||||
| Secret | Purpose |
|
||||
|--------|---------|
|
||||
| `COOLIFY_WEBHOOK` | Deploy Webhook URL from the Coolify resource |
|
||||
| `COOLIFY_TOKEN` | Coolify API token with `deploy` permission |
|
||||
|
||||
The workflow calls:
|
||||
|
||||
```sh
|
||||
curl --request GET "$COOLIFY_WEBHOOK" \
|
||||
--header "Authorization: Bearer $COOLIFY_TOKEN"
|
||||
```
|
||||
|
||||
## Coolify MCP
|
||||
|
||||
Coolify's MCP server is read-only. Enable it in Coolify with a `root` API token:
|
||||
|
||||
```sh
|
||||
curl -X POST http://192.168.1.101:8000/api/v1/mcp/enable \
|
||||
-H "Authorization: Bearer <root-token>"
|
||||
```
|
||||
|
||||
Then configure MCP clients with:
|
||||
|
||||
- URL: `http://192.168.1.101:8000/mcp`
|
||||
- Header: `Authorization: Bearer <read-token>`
|
||||
|
||||
Use a token with `read` permission for MCP, not `root`.
|
||||
|
||||
## Local Test
|
||||
|
||||
```sh
|
||||
docker build -t template:local .
|
||||
docker run --rm -p 8080:80 template:local
|
||||
```
|
||||
64
public/index.html
Normal file
64
public/index.html
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Template</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--bg: #0f110c;
|
||||
--panel: #181b12;
|
||||
--text: #f8f3df;
|
||||
--muted: #aaa18b;
|
||||
--accent: #c8ff2e;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background:
|
||||
linear-gradient(rgba(248, 243, 223, .045) 1px, transparent 1px),
|
||||
linear-gradient(90deg, rgba(248, 243, 223, .045) 1px, transparent 1px),
|
||||
radial-gradient(circle at 20% 0%, rgba(200, 255, 46, .18), transparent 30%),
|
||||
var(--bg);
|
||||
background-size: 34px 34px, 34px 34px, auto, auto;
|
||||
color: var(--text);
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
}
|
||||
main {
|
||||
width: min(720px, calc(100vw - 32px));
|
||||
padding: 36px;
|
||||
border: 1px solid rgba(248, 243, 223, .14);
|
||||
border-radius: 8px;
|
||||
background: rgba(24, 27, 18, .9);
|
||||
box-shadow: 12px 12px 0 rgba(200, 255, 46, .11);
|
||||
}
|
||||
p:first-child {
|
||||
margin: 0 0 12px;
|
||||
color: var(--accent);
|
||||
font-weight: 800;
|
||||
letter-spacing: .1em;
|
||||
text-transform: uppercase;
|
||||
font-size: 12px;
|
||||
}
|
||||
h1 {
|
||||
margin: 0 0 14px;
|
||||
font-size: clamp(40px, 8vw, 76px);
|
||||
line-height: .92;
|
||||
letter-spacing: -.07em;
|
||||
}
|
||||
p { color: var(--muted); line-height: 1.6; }
|
||||
code { color: var(--accent); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<p>Forgejo to Coolify</p>
|
||||
<h1>Deployment template is alive.</h1>
|
||||
<p>Push to <code>main</code>, let Forgejo Actions call the Coolify Deploy Webhook, and keep the app source in Forgejo.</p>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Reference in a new issue