From b49046674447d70d6efecde4c6d33392d76d2fae Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Tue, 23 Dec 2025 20:13:31 +0100 Subject: [PATCH] Add templates --- README.md | 4 +++- docker/README.md | 0 docker/build/build-image.sh | 23 +++++++++++++++++++ docker/build/docker-build.yml | 16 +++++++++++++ docker/deploy/docker-deploy.yml | 0 flutter/android/flutter-android.yml | 0 flutter/build/flutter-build.yml | 0 flutter/ios/flutter-ios.yml | 0 ftp/ftp-deploy.yml | 0 kube/README.md | 0 kube/helm.yml | 0 latex/README.md | 0 latex/latex-compile.yml | 30 +++++++++++++++++++++++++ lint-format/eslint/eslint.yml | 0 lint-format/latexindent/latexindent.yml | 0 node/node-build.yml | 0 python/pyinstaller-build.yml | 0 shell/shell-run.yml | 20 +++++++++++++++++ 18 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 docker/README.md create mode 100755 docker/build/build-image.sh create mode 100644 docker/build/docker-build.yml create mode 100644 docker/deploy/docker-deploy.yml create mode 100644 flutter/android/flutter-android.yml create mode 100644 flutter/build/flutter-build.yml create mode 100644 flutter/ios/flutter-ios.yml create mode 100644 ftp/ftp-deploy.yml create mode 100644 kube/README.md create mode 100644 kube/helm.yml create mode 100644 latex/README.md create mode 100644 latex/latex-compile.yml create mode 100644 lint-format/eslint/eslint.yml create mode 100644 lint-format/latexindent/latexindent.yml create mode 100644 node/node-build.yml create mode 100644 python/pyinstaller-build.yml create mode 100644 shell/shell-run.yml diff --git a/README.md b/README.md index 4d223df..f45816f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # workflow-templates -A collection of workflow templates that can be used in other repos \ No newline at end of file +A collection of workflow templates that can be used in other repos + +Many of the templates are not available yet diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..e69de29 diff --git a/docker/build/build-image.sh b/docker/build/build-image.sh new file mode 100755 index 0000000..356c421 --- /dev/null +++ b/docker/build/build-image.sh @@ -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 diff --git a/docker/build/docker-build.yml b/docker/build/docker-build.yml new file mode 100644 index 0000000..c120639 --- /dev/null +++ b/docker/build/docker-build.yml @@ -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 diff --git a/docker/deploy/docker-deploy.yml b/docker/deploy/docker-deploy.yml new file mode 100644 index 0000000..e69de29 diff --git a/flutter/android/flutter-android.yml b/flutter/android/flutter-android.yml new file mode 100644 index 0000000..e69de29 diff --git a/flutter/build/flutter-build.yml b/flutter/build/flutter-build.yml new file mode 100644 index 0000000..e69de29 diff --git a/flutter/ios/flutter-ios.yml b/flutter/ios/flutter-ios.yml new file mode 100644 index 0000000..e69de29 diff --git a/ftp/ftp-deploy.yml b/ftp/ftp-deploy.yml new file mode 100644 index 0000000..e69de29 diff --git a/kube/README.md b/kube/README.md new file mode 100644 index 0000000..e69de29 diff --git a/kube/helm.yml b/kube/helm.yml new file mode 100644 index 0000000..e69de29 diff --git a/latex/README.md b/latex/README.md new file mode 100644 index 0000000..e69de29 diff --git a/latex/latex-compile.yml b/latex/latex-compile.yml new file mode 100644 index 0000000..8c7065f --- /dev/null +++ b/latex/latex-compile.yml @@ -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] diff --git a/lint-format/eslint/eslint.yml b/lint-format/eslint/eslint.yml new file mode 100644 index 0000000..e69de29 diff --git a/lint-format/latexindent/latexindent.yml b/lint-format/latexindent/latexindent.yml new file mode 100644 index 0000000..e69de29 diff --git a/node/node-build.yml b/node/node-build.yml new file mode 100644 index 0000000..e69de29 diff --git a/python/pyinstaller-build.yml b/python/pyinstaller-build.yml new file mode 100644 index 0000000..e69de29 diff --git a/shell/shell-run.yml b/shell/shell-run.yml new file mode 100644 index 0000000..5ab133a --- /dev/null +++ b/shell/shell-run.yml @@ -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]