Add templates
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
# workflow-templates
|
# 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
|
||||||
|
|||||||
Executable
+23
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
Reference in New Issue
Block a user