Skip to content

Commit a06c1d7

Browse files
committed
Changing pipeline for testing.
1 parent 75d88fb commit a06c1d7

File tree

1 file changed

+51
-39
lines changed

1 file changed

+51
-39
lines changed

.github/workflows/BuildImage.yml

Lines changed: 51 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,61 @@
11
name: Build Image
22

3-
on: [push, pull_request_target, workflow_dispatch]
3+
on: [push, pull_request, workflow_dispatch]
44

55
env:
6-
GITHUB_REPO: "linuxserver/docker-mods" #don't modify
7-
ENDPOINT: "linuxserver/mods" #don't modify
8-
BASEIMAGE: "swag" #replace
9-
MODNAME: "auto-uptime-kuma" #replace
10-
MULTI_ARCH: "false" #set to false if not needed
6+
ENDPOINT: "TrezOne/swag-auto-uptime-kuma"
7+
BRANCH: "swag-auto-uptime-kuma-timeout-fix_2025-06-20T09-38-36"
118

129
jobs:
13-
set-vars:
10+
build:
1411
runs-on: ubuntu-latest
1512
steps:
16-
- name: Set Vars
17-
id: outputs
13+
- uses: actions/checkout@v3
14+
15+
- name: Build image
1816
run: |
19-
echo "GITHUB_REPO=${{ env.GITHUB_REPO }}" >> $GITHUB_OUTPUT
20-
echo "ENDPOINT=${{ env.ENDPOINT }}" >> $GITHUB_OUTPUT
21-
echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT
22-
echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT
23-
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=""
26-
echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT
27-
outputs:
28-
GITHUB_REPO: ${{ steps.outputs.outputs.GITHUB_REPO }}
29-
ENDPOINT: ${{ steps.outputs.outputs.ENDPOINT }}
30-
BASEIMAGE: ${{ steps.outputs.outputs.BASEIMAGE }}
31-
MODNAME: ${{ steps.outputs.outputs.MODNAME }}
32-
MULTI_ARCH: ${{ steps.outputs.outputs.MULTI_ARCH }}
33-
MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }}
17+
docker build --no-cache -t ${{ github.sha }} .
3418
35-
build:
36-
uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v1
37-
needs: set-vars
38-
secrets:
39-
CR_USER: ${{ secrets.CR_USER }}
40-
CR_PAT: ${{ secrets.CR_PAT }}
41-
DOCKERUSER: ${{ secrets.DOCKERUSER }}
42-
DOCKERPASS: ${{ secrets.DOCKERPASS }}
43-
with:
44-
GITHUB_REPO: ${{ needs.set-vars.outputs.GITHUB_REPO }}
45-
ENDPOINT: ${{ needs.set-vars.outputs.ENDPOINT }}
46-
BASEIMAGE: ${{ needs.set-vars.outputs.BASEIMAGE }}
47-
MODNAME: ${{ needs.set-vars.outputs.MODNAME }}
48-
MULTI_ARCH: ${{ needs.set-vars.outputs.MULTI_ARCH }}
49-
MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }}
19+
- name: Tag image
20+
if: ${{ github.ref == format('refs/heads/{0}', env.BRANCH) && env.ENDPOINT != 'user/endpoint' }}
21+
run: |
22+
docker tag ${{ github.sha }} ${ENDPOINT}
23+
docker tag ${{ github.sha }} ${ENDPOINT}:${{ github.sha }}
24+
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}
25+
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${{ github.sha }}
26+
27+
- name: Credential check
28+
if: ${{ github.ref == format('refs/heads/{0}', env.BRANCH) && env.ENDPOINT != 'user/endpoint' }}
29+
run: |
30+
echo "CR_USER=${{ secrets.CR_USER }}" >> $GITHUB_ENV
31+
echo "CR_PAT=${{ secrets.CR_PAT }}" >> $GITHUB_ENV
32+
echo "DOCKERUSER=${{ secrets.DOCKERUSER }}" >> $GITHUB_ENV
33+
echo "DOCKERPASS=${{ secrets.DOCKERPASS }}" >> $GITHUB_ENV
34+
if [[ "${{ secrets.CR_USER }}" == "" && "${{ secrets.CR_PAT }}" == "" && "${{ secrets.DOCKERUSER }}" == "" && "${{ secrets.DOCKERPASS }}" == "" ]]; then
35+
echo "::error::Push credential secrets missing."
36+
echo "::error::You must set either CR_USER & CR_PAT or DOCKERUSER & DOCKERPASS as secrets in your repo settings."
37+
echo "::error::See https://github.com/linuxserver/docker-mods/blob/master/README.md for more information/instructions."
38+
exit 1
39+
fi
40+
41+
- name: Login to GitHub Container Registry
42+
if: ${{ github.ref == format('refs/heads/{0}', env.BRANCH) && env.CR_USER && env.CR_PAT && env.ENDPOINT != 'user/endpoint' }}
43+
run: |
44+
echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ secrets.CR_USER }} --password-stdin
45+
46+
- name: Push tags to GitHub Container Registry
47+
if: ${{ github.ref == format('refs/heads/{0}', env.BRANCH) && env.CR_USER && env.CR_PAT && env.ENDPOINT != 'user/endpoint' }}
48+
run: |
49+
docker push ghcr.io/${ENDPOINT}:${{ github.sha }}
50+
docker push ghcr.io/${ENDPOINT}
51+
52+
- name: Login to DockerHub
53+
if: ${{ github.ref == format('refs/heads/{0}', env.BRANCH) && env.DOCKERUSER && env.DOCKERPASS && env.ENDPOINT != 'user/endpoint' }}
54+
run: |
55+
echo ${{ secrets.DOCKERPASS }} | docker login -u ${{ secrets.DOCKERUSER }} --password-stdin
56+
57+
- name: Push tags to DockerHub
58+
if: ${{ github.ref == format('refs/heads/{0}', env.BRANCH) && env.DOCKERUSER && env.DOCKERPASS && env.ENDPOINT != 'user/endpoint' }}
59+
run: |
60+
docker push ${ENDPOINT}:${{ github.sha }}
61+
docker push ${ENDPOINT}

0 commit comments

Comments
 (0)