Trying new build strategy
Some checks failed
Build Container / Git Tag (push) Successful in 3s
Build Container / Build Container (push) Failing after 7s

This commit is contained in:
Zakary Timson 2025-04-03 23:50:50 -04:00
parent 37247ce478
commit d0be16d47b

View File

@ -13,20 +13,20 @@ jobs:
- name: Build Container
run: |
git clone -b "${{github.ref_name}}" "$(echo ${{github.server_url}}/${{github.repository}}.git | sed s%://%://${{github.token}}@% )" .
REGISTRY=$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%% )
VERSION=$(cat Dockerfile | grep "ARG CADDY_VERSION" | grep -Eo '=.+' | grep -Eo '[[:alnum:]\.\/\-]+')
docker login -u ${{repository_owner}} -p ${{secrets.DEPLOY_TOKEN}} $REGISTRY
REGISTRY="$(echo ${{github.server_url}} | sed s%http://%% | sed s%https://%% )"
VERSION="$(cat Dockerfile | grep "ARG CADDY_VERSION" | grep -Eo '=.+' | grep -Eo '[[:alnum:]\.\/\-]+')"
docker build -t $REGISTRY/${{github.repository}}:${{ github.ref_name}} .
docker login -u ${{github.repository_owner}} -p ${{secrets.DEPLOY_TOKEN}} $REGISTRY
docker push $REGISTRY/${{github.repository}}:${{ github.ref_name}}
docker tag $REGISTRY/${{github.repository}}:$VERSION $REGISTRY/${{github.repository}}:${{github.ref_name}}
docker push $REGISTRY/${{github.repository}}:$VERSION
if [ '${{github.ref_name}}' == 'master' ]; then
docker tag $REGISTRY/${{github.repository}}:$VERSION $REGISTRY/${{github.repository}}:${{github.ref_name}}
docker push $REGISTRY/${{github.repository}}:$VERSION
[ '${{github.ref_name}}' == 'master' ] && \
docker tag $REGISTRY/${{github.repository}}:latest $REGISTRY/${{github.repository}}:${{github.ref_name}} && \
docker push $REGISTRY/${{github.repository}}:latest || echo ''
docker push $REGISTRY/${{github.repository}}:latest
fi
tag:
name: Git Tag
@ -36,7 +36,7 @@ jobs:
- name: Git Tag
run: |
git clone -b "${{github.ref_name}}" "$(echo ${{github.server_url}}/${{github.repository}}.git | sed s%://%://${{github.token}}@% )" .
VERSION=$(cat Dockerfile | grep "ARG CADDY_VERSION" | grep -Eo '=.+' | grep -Eo '[[:alnum:]\.\/\-]+')
VERSION="$(cat Dockerfile | grep "ARG CADDY_VERSION" | grep -Eo '=.+' | grep -Eo '[[:alnum:]\.\/\-]+')"
git tag -f $VERSION ${{github.sha}}
git push -f origin $VERSION