Add templates

This commit is contained in:
2025-12-23 20:13:31 +01:00
parent cdfb5169c9
commit b490466744
18 changed files with 92 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
# workflow-templates
A collection of workflow templates that can be used in other repos
A collection of workflow templates that can be used in other repos
Many of the templates are not available yet

0
docker/README.md Normal file
View File

23
docker/build/build-image.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
set -e
echo "=> Build will be tagged with $1 and build directory is $(pwd)"
OLD_IMG=$(docker image ls -q "$1")
docker buildx build . -t "$1"
echo "
=> Build complete, starting upload...
"
docker push "$1"
if [ -n "$OLD_IMG" ]; then
if [ "$OLD_IMG" != "$(docker image ls -q "$1")" ]; then
echo "
=> New build uploaded, removing old image, id: $OLD_IMG
"
docker image rmi -f "$OLD_IMG" || true
fi
fi

View File

@@ -0,0 +1,16 @@
name: Create and publish container
on:
push
jobs:
build_container:
runs_on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v6
with:
ref: main
- name: Build and upload image
run: |
docker login ${{ vars.REGISTRY_URL }} -u ${{ vars.REGISTRY_USER_USERNAME }} -p "${{ secrets.REGISTRY_USER_PASSWORD_ESCAPED }}"
# Run the docker build command. Preferrably use the provided wrapper function
./build-image.sh ${{ vars.REGISTRY_NAME }}/container-name

View File

View File

View File

View File

0
ftp/ftp-deploy.yml Normal file
View File

0
kube/README.md Normal file
View File

0
kube/helm.yml Normal file
View File

0
latex/README.md Normal file
View File

30
latex/latex-compile.yml Normal file
View File

@@ -0,0 +1,30 @@
name: Build LaTeX file
on:
push:
paths:
- 'paths/to/build/**'
jobs:
build_docs:
runs_on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v6
- name: Sign into gitea registry
uses: https://github.com/docker/login-action@v3
with:
username: ${{ vars.REGISTRY_USER_USERNAME }}
password: ${{ secrets.REGISTRY_USER_PASSWORD }}
registry: ${{ vars.REGISTRY_BASE_URL }}
- name: Run build
uses: actions/latex-full@main
with:
workdir: relative/path/to/build/dir/or/''
include_helpers: true # Whether or not to include helpers
- name: Upload compiled docs
uses: actions/git-auto-commit-action@v7
with:
commit_message: "[skip ci] Build docs on push"
file_pattern: '*.pdf'
commit_user_name: LaTeX compiler [bot]
commit_user_email: actions@janishutz.com
commit_author: LaTeX compiler [bot] <actions@janishutz.com>

View File

View File

0
node/node-build.yml Normal file
View File

View File

20
shell/shell-run.yml Normal file
View File

@@ -0,0 +1,20 @@
name: Build helpers
on:
push:
paths:
- 'path/to/trigger/from/**'
jobs:
build_helpers:
runs_on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v6
- name: Execute shell script
run: ./build.sh
- name: Upload result
uses: actions/git-auto-commit-action@v7
with:
commit_message: "[skip ci] Build helpers on push"
commit_user_name: Helpers compiler [bot]
commit_user_email: actions@janishutz.com
commit_author: Helpers compiler [bot] <actions@janishutz.com>