Skip to content

Commit e3e0998

Browse files
committed
Add v2 sample workflow
1 parent 2791cfc commit e3e0998

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/BuildImage.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
name: Build Image
22

3-
on: [push, pull_request_target, workflow_dispatch]
3+
on:
4+
push:
5+
pull_request_target:
6+
workflow_dispatch:
7+
inputs:
8+
mod_version:
9+
type: string
10+
required: false
411

512
env:
613
GITHUB_REPO: "linuxserver/docker-mods" #don't modify
714
ENDPOINT: "linuxserver/mods" #don't modify
815
BASEIMAGE: "replace_baseimage" #replace
916
MODNAME: "replace_modname" #replace
17+
MOD_VERSION: ${{ inputs.mod_version }} #don't modify
1018
MULTI_ARCH: "true" #set to false if not needed
1119

1220
jobs:
@@ -21,8 +29,13 @@ jobs:
2129
echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT
2230
echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT
2331
echo "MULTI_ARCH=${{ env.MULTI_ARCH }}" >> $GITHUB_OUTPUT
24-
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
25-
MOD_VERSION=""
32+
if [[ -z "${{ env.MOD_VERSION }}" ]]; then
33+
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
34+
MOD_VERSION=""
35+
else
36+
MOD_VERSION=${{ env.MOD_VERSION }}
37+
echo "MOD_VERSION_OVERRIDE=true" >> $GITHUB_OUTPUT
38+
fi
2639
echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT
2740
outputs:
2841
GITHUB_REPO: ${{ steps.outputs.outputs.GITHUB_REPO }}
@@ -31,9 +44,10 @@ jobs:
3144
MODNAME: ${{ steps.outputs.outputs.MODNAME }}
3245
MULTI_ARCH: ${{ steps.outputs.outputs.MULTI_ARCH }}
3346
MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }}
47+
MOD_VERSION_OVERRIDE: ${{ steps.outputs.outputs.MOD_VERSION_OVERRIDE }}
3448

3549
build:
36-
uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v1
50+
uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v2
3751
needs: set-vars
3852
secrets:
3953
CR_USER: ${{ secrets.CR_USER }}
@@ -47,3 +61,4 @@ jobs:
4761
MODNAME: ${{ needs.set-vars.outputs.MODNAME }}
4862
MULTI_ARCH: ${{ needs.set-vars.outputs.MULTI_ARCH }}
4963
MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }}
64+
MOD_VERSION_OVERRIDE: ${{ needs.set-vars.outputs.MOD_VERSION_OVERRIDE }}

0 commit comments

Comments
 (0)