ztimson 2fdac10aa7
Some checks failed
Build Container / Build Docker Container (push) Failing after 3s
Build Container / Tag Version (push) Failing after 2s
Trying new build strategy
2025-04-03 23:27:46 -04:00

36 lines
1.7 KiB
YAML

name: Build Container
run-name: Build Container
on:
push:
jobs:
docker:
name: Build Docker Container
runs-on: ubuntu-latest
container: docker
steps:
- 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:]\.\/\-]+')
docker build -t ${{ github.server_url }}/${{ github.repository }}:$VERSION .
docker push ${{ github.server_url }}/${{ github.repository }}:$VERSION
docker tag ${{ github.server_url }}/${{ github.repository }}:${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}:$VERSION
docker push ${{ github.server_url }}/${{ github.repository }}:${{ github.ref_name }}
[ '${{ github.ref_name }}' == 'master' ] && \
docker tag ${{ github.server_url }}/${{ github.repository }}:latest ${{ github.server_url }}/${{ github.repository }}:$VERSION && \
docker push ${{ github.server_url }}/${{ github.repository }}:latest || echo ''
tag:
name: Tag Version
runs-on: ubuntu-latest
container: node
steps:
- 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:]\.\/\-]+')
tag -f $VERSION ${{github.sha}}
git push -f origin $VERSION