ci: add action

This commit is contained in:
Hamcha 2024-04-07 23:15:31 +02:00
parent f8fe23cecd
commit b1fe38da5a
Signed by: hamcha
GPG Key ID: 1669C533B8CF6D89
4 changed files with 45 additions and 4 deletions

View File

@ -0,0 +1,23 @@
name: Build and push Docker image
# Only on new tags
on:
push:
tags:
- "*.*.*"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Update jsr.json
run: sed -i "s/x.x.x/${{ github.ref_name }}/g" jsr.json
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: deno publish

7
LICENSE.txt Normal file
View File

@ -0,0 +1,7 @@
ISC License
Copyright 2024 staxman authors
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -1,5 +1,9 @@
{
"$schema": "https://jsr.io/schema/config-file.v1.json",
"name": "@staxman/containerlib",
"version": "0.1.1",
"exports": "./mod.ts"
"version": "x.x.x",
"exports": "./mod.ts",
"publish": {
"exclude": [".forgejo"]
}
}

View File

@ -7,10 +7,17 @@ export function registerDeployment(stack: Stack) {
deployments.push(stack);
}
globalThis.addEventListener("unload", () => {
export function getStacks(): Record<string, ComposeSpecification> {
const stacks: Record<string, ComposeSpecification> = {};
for (const stack of deployments) {
stacks[stack.name] = stack.toComposeFile();
}
console.log(JSON.stringify(stacks, null, 2));
return stacks;
}
globalThis.addEventListener("unload", () => {
if (deployments.length > 0) {
// Print stacks
console.log(JSON.stringify(getStacks(), null, 2));
}
});