6 Commits
v1 ... v2

Author SHA1 Message Date
e5f2ee9eda V2
All checks were successful
Push to main / Reset-Version-Tag (push) Successful in 6s
2026-03-05 07:42:01 -07:00
5453bc5d3a V2
All checks were successful
Push to main / Reset-Version-Tag (push) Successful in 7s
2026-03-05 07:39:53 -07:00
89bf9dd69b V2
All checks were successful
Push to main / Reset-Version-Tag (push) Successful in 6s
2026-03-05 07:37:01 -07:00
38d3c0242d fix imports
All checks were successful
Push to main / Reset-Version-Tag (push) Successful in 6s
2026-03-05 07:26:00 -07:00
dfad87ccf7 v2
All checks were successful
Push to main / Reset-Version-Tag (push) Successful in 6s
2026-03-05 07:25:00 -07:00
19dd8f0430 v2
All checks were successful
Push to main / Reset-Version-Tag (push) Successful in 7s
2026-03-05 07:14:39 -07:00
5 changed files with 38 additions and 20 deletions

View File

@@ -10,7 +10,7 @@ jobs:
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v3 uses: actions/checkout@v3
- run: git tag -d v1 || true - run: git tag -d v2 || true
- run: git push --delete origin v1 || true - run: git push --delete origin v2 || true
- run: git tag v1 - run: git tag v2
- run: git push --tags - run: git push --tags

23
action.js Normal file
View File

@@ -0,0 +1,23 @@
import { execSync } from "child_process";
import { readFileSync } from "fs";
const tag = JSON.parse(
readFileSync("package.json", { encoding: "utf8" }),
).version;
console.log("============= INSTALLING DOCKER ==============");
execSync("curl -fsSL https://get.docker.com -o get-docker.sh");
execSync("sh get-docker.sh");
execSync("rm get-docker.sh");
console.log("======== LOGGING IN TO CONTAINER REPO ========");
execSync(
"docker login $INPUT_CONTAINER_DOMAIN -u $INPUT_LOGIN_USER --password $INPUT_LOGIN_PASS",
);
console.log("============= BUILDING CONTAINER =============");
execSync(
`docker build -t $INPUT_CONTAINER_DOMAIN/$INPUT_CONTAINER_NAME:latest -t $INPUT_CONTAINER_DOMAIN/$INPUT_CONTAINER_NAME:${tag} --no-cache .`,
);
console.log("============= PUSHING CONTAINER ==============");
execSync(`docker push $INPUT_CONTAINER_DOMAIN/$INPUT_CONTAINER_NAME:${tag}`);
execSync(`docker push $INPUT_CONTAINER_DOMAIN/$INPUT_CONTAINER_NAME:latest`);

View File

@@ -1,13 +0,0 @@
### INSTALL DOCKER
echo "get docker install script"
curl -fsSL https://get.docker.com -o get-docker.sh
echo "run docker install script"
sh get-docker.sh
### LOGIN TO CONTAINER REPO
echo "run docker login"
docker login $INPUT_CONTAINER_DOMAIN -u $INPUT_LOGIN_USER --password $INPUT_LOGIN_PASS
echo "run docker build"
docker build -t $INPUT_CONTAINER_DOMAIN/$INPUT_CONTAINER_NAME:$INPUT_CONTAINER_TAG --no-cache .
echo "run docker push"
docker push $INPUT_CONTAINER_DOMAIN/$INPUT_CONTAINER_NAME:$INPUT_CONTAINER_TAG

View File

@@ -14,11 +14,8 @@ inputs:
container_name: container_name:
description: container name (org/package) description: container name (org/package)
required: true required: true
container_tag:
description: container tag (latest)
required: true
runs: runs:
using: "composite" using: "composite"
steps: steps:
- run: $GITHUB_ACTION_PATH/action.sh - run: node $GITHUB_ACTION_PATH/action.js
shell: bash shell: bash

11
package.json Normal file
View File

@@ -0,0 +1,11 @@
{
"name": "container_publish",
"version": "1.0.0",
"description": "gitea action for publishing the latest changes to a container repository",
"repository": {
"type": "git",
"url": "git@git.thorup.us:actions/container_publish.git"
},
"type": "module",
"main": "action.js"
}