Skip to content

Commit 7d423dd

Browse files
committed
Re-adding temp workflow.
1 parent 697568b commit 7d423dd

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/BuildTest.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Temporary Build Test
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
env:
6+
ENDPOINT: "trezone/swag-auto-uptime-kuma"
7+
BRANCH: "swag-auto-uptime-kuma-timeout-fix_2025-06-20T09-38-36"
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/[email protected]
14+
15+
- name: Build image
16+
run: |
17+
docker build --no-cache -t ${{ github.sha }} .
18+
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)