New version format
Some checks failed
Build on push / prepare (push) Successful in 4s
Build on push / build-api (push) Failing after 5s
Build on push / build-redirector (push) Failing after 5s
Build on push / build-web (push) Has been cancelled

This commit is contained in:
Sven Heidemann 2025-01-17 19:45:18 +01:00
parent b72916a8d9
commit 1189502d7d
3 changed files with 84 additions and 17 deletions

View File

@ -1,13 +1,45 @@
name: Build dev on push
run-name: Build dev on push
name: Build on push
run-name: Build on push
on:
push:
branches:
- dev
jobs:
prepare:
runs-on: [runner]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
outputs:
build_version: ${{ steps.set-version.outputs.build_version }}
steps:
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
with:
token: ${{ secrets.CI_ACCESS_TOKEN }}
- name: Get Date and Build Number
run: |
DATE=$(date +'%Y.%m.%d')
git fetch --tags
TAG_COUNT=$(git tag -l "${DATE}.*" | wc -l)
BUILD_NUMBER=$(($TAG_COUNT + 1))
BUILD_VERSION="${DATE}.${BUILD_NUMBER}-dev"
echo "::set-output name=build_version::$BUILD_VERSION"
- name: Create Git Tag for Build
run: |
git config user.name "ci"
git config user.email "dev@sh-edratf.de"
git tag ${{ env.BUILD_VERSION }}
git push origin ${{ env.BUILD_VERSION }}
- name: Save Version Info
run: |
echo "VERSION = \"${{ env.BUILD_VERSION }}\"" > api/version.py
build-api:
runs-on: [runner]
needs: [prepare]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Clone Repository
@ -18,7 +50,7 @@ jobs:
- name: Build docker
run: |
cd api
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-api-dev:$(cat ../version.txt) .
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-api:${{ needs.prepare.outputs.build_version }} .
- name: Login to registry git.sh-edraft.de
uses: https://github.com/docker/login-action@v1
@ -29,10 +61,11 @@ jobs:
- name: Push image
run: |
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-api-dev:$(cat version.txt)
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-api:${{ needs.prepare.outputs.build_version }}
build-redirector:
runs-on: [runner]
needs: [prepare]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Clone Repository
@ -43,7 +76,7 @@ jobs:
- name: Build docker
run: |
cd api
docker build -f dockerfile_redirector -t git.sh-edraft.de/sh-edraft.de/open-redirect-redirector-dev:$(cat ../version.txt) .
docker build -f dockerfile_redirector -t git.sh-edraft.de/sh-edraft.de/open-redirect-redirector:${{ needs.prepare.outputs.build_version }} .
- name: Login to registry git.sh-edraft.de
uses: https://github.com/docker/login-action@v1
@ -54,10 +87,11 @@ jobs:
- name: Push image
run: |
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-redirector-dev:$(cat version.txt)
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-redirector:${{ needs.prepare.outputs.build_version }}
build-web:
runs-on: [runner]
needs: [prepare]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Clone Repository
@ -78,7 +112,7 @@ jobs:
- name: Build docker
run: |
cd web
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-web-dev:$(cat ../version.txt) .
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-web:${{ needs.prepare.outputs.build_version }} .
- name: Login to registry git.sh-edraft.de
uses: https://github.com/docker/login-action@v1
@ -89,4 +123,4 @@ jobs:
- name: Push image
run: |
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-web-dev:$(cat version.txt)
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-web:${{ needs.prepare.outputs.build_version }}

View File

@ -6,8 +6,40 @@ on:
- master
jobs:
prepare:
runs-on: [runner]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
outputs:
build_version: ${{ steps.set-version.outputs.build_version }}
steps:
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
with:
token: ${{ secrets.CI_ACCESS_TOKEN }}
- name: Get Date and Build Number
run: |
DATE=$(date +'%Y.%m.%d')
git fetch --tags
TAG_COUNT=$(git tag -l "${DATE}.*" | wc -l)
BUILD_NUMBER=$(($TAG_COUNT + 1))
BUILD_VERSION="${DATE}.${BUILD_NUMBER}"
echo "::set-output name=build_version::$BUILD_VERSION"
- name: Create Git Tag for Build
run: |
git config user.name "ci"
git config user.email "dev@sh-edratf.de"
git tag ${{ env.BUILD_VERSION }}
git push origin ${{ env.BUILD_VERSION }}
- name: Save Version Info
run: |
echo "VERSION = \"${{ env.BUILD_VERSION }}\"" > api/version.py
build-api:
runs-on: [runner]
needs: [prepare]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Clone Repository
@ -18,7 +50,7 @@ jobs:
- name: Build docker
run: |
cd api
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-api:$(cat ../version.txt) .
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-api:${{ needs.prepare.outputs.build_version }} .
- name: Login to registry git.sh-edraft.de
uses: https://github.com/docker/login-action@v1
@ -29,10 +61,11 @@ jobs:
- name: Push image
run: |
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-api:$(cat version.txt)
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-api:${{ needs.prepare.outputs.build_version }}
build-redirector:
runs-on: [runner]
needs: [prepare]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Clone Repository
@ -43,7 +76,7 @@ jobs:
- name: Build docker
run: |
cd api
docker build -f dockerfile_redirector -t git.sh-edraft.de/sh-edraft.de/open-redirect-redirector:$(cat ../version.txt) .
docker build -f dockerfile_redirector -t git.sh-edraft.de/sh-edraft.de/open-redirect-redirector:${{ needs.prepare.outputs.build_version }} .
- name: Login to registry git.sh-edraft.de
uses: https://github.com/docker/login-action@v1
@ -54,10 +87,11 @@ jobs:
- name: Push image
run: |
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-redirector:$(cat version.txt)
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-redirector:${{ needs.prepare.outputs.build_version }}
build-web:
runs-on: [runner]
needs: [prepare]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
steps:
- name: Clone Repository
@ -78,7 +112,7 @@ jobs:
- name: Build docker
run: |
cd web
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat ../version.txt) .
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-web:${{ needs.prepare.outputs.build_version }} .
- name: Login to registry git.sh-edraft.de
uses: https://github.com/docker/login-action@v1
@ -89,4 +123,4 @@ jobs:
- name: Push image
run: |
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat version.txt)
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-web:${{ needs.prepare.outputs.build_version }}

View File

@ -1 +0,0 @@
1.2.1