New version format
This commit is contained in:
parent
b72916a8d9
commit
608b35f27e
@ -1,13 +1,43 @@
|
|||||||
name: Build dev on push
|
name: Build on push
|
||||||
run-name: Build dev on push
|
run-name: Build on push
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
prepare:
|
||||||
|
runs-on: [runner]
|
||||||
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
|
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 "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- 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:
|
build-api:
|
||||||
runs-on: [runner]
|
runs-on: [runner]
|
||||||
|
needs: [prepare]
|
||||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
@ -18,7 +48,7 @@ jobs:
|
|||||||
- name: Build docker
|
- name: Build docker
|
||||||
run: |
|
run: |
|
||||||
cd api
|
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:${{ env.BUILD_VERSION }} .
|
||||||
|
|
||||||
- name: Login to registry git.sh-edraft.de
|
- name: Login to registry git.sh-edraft.de
|
||||||
uses: https://github.com/docker/login-action@v1
|
uses: https://github.com/docker/login-action@v1
|
||||||
@ -29,10 +59,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
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:$(cat version.txt)
|
||||||
|
|
||||||
build-redirector:
|
build-redirector:
|
||||||
runs-on: [runner]
|
runs-on: [runner]
|
||||||
|
needs: [prepare]
|
||||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
@ -43,7 +74,7 @@ jobs:
|
|||||||
- name: Build docker
|
- name: Build docker
|
||||||
run: |
|
run: |
|
||||||
cd api
|
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:${{ env.BUILD_VERSION }} .
|
||||||
|
|
||||||
- name: Login to registry git.sh-edraft.de
|
- name: Login to registry git.sh-edraft.de
|
||||||
uses: https://github.com/docker/login-action@v1
|
uses: https://github.com/docker/login-action@v1
|
||||||
@ -54,10 +85,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
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:$(cat version.txt)
|
||||||
|
|
||||||
build-web:
|
build-web:
|
||||||
runs-on: [runner]
|
runs-on: [runner]
|
||||||
|
needs: [prepare]
|
||||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
@ -78,7 +110,7 @@ jobs:
|
|||||||
- name: Build docker
|
- name: Build docker
|
||||||
run: |
|
run: |
|
||||||
cd web
|
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:${{ env.BUILD_VERSION }} .
|
||||||
|
|
||||||
- name: Login to registry git.sh-edraft.de
|
- name: Login to registry git.sh-edraft.de
|
||||||
uses: https://github.com/docker/login-action@v1
|
uses: https://github.com/docker/login-action@v1
|
||||||
@ -89,4 +121,4 @@ jobs:
|
|||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
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:$(cat version.txt)
|
||||||
|
@ -6,8 +6,38 @@ on:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
prepare:
|
||||||
|
runs-on: [runner]
|
||||||
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
|
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 "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- 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:
|
build-api:
|
||||||
runs-on: [runner]
|
runs-on: [runner]
|
||||||
|
needs: [prepare]
|
||||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
@ -18,7 +48,7 @@ jobs:
|
|||||||
- name: Build docker
|
- name: Build docker
|
||||||
run: |
|
run: |
|
||||||
cd api
|
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:${{ env.BUILD_VERSION }} .
|
||||||
|
|
||||||
- name: Login to registry git.sh-edraft.de
|
- name: Login to registry git.sh-edraft.de
|
||||||
uses: https://github.com/docker/login-action@v1
|
uses: https://github.com/docker/login-action@v1
|
||||||
@ -33,6 +63,7 @@ jobs:
|
|||||||
|
|
||||||
build-redirector:
|
build-redirector:
|
||||||
runs-on: [runner]
|
runs-on: [runner]
|
||||||
|
needs: [prepare]
|
||||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
@ -43,7 +74,7 @@ jobs:
|
|||||||
- name: Build docker
|
- name: Build docker
|
||||||
run: |
|
run: |
|
||||||
cd api
|
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:${{ env.BUILD_VERSION }} .
|
||||||
|
|
||||||
- name: Login to registry git.sh-edraft.de
|
- name: Login to registry git.sh-edraft.de
|
||||||
uses: https://github.com/docker/login-action@v1
|
uses: https://github.com/docker/login-action@v1
|
||||||
@ -58,6 +89,7 @@ jobs:
|
|||||||
|
|
||||||
build-web:
|
build-web:
|
||||||
runs-on: [runner]
|
runs-on: [runner]
|
||||||
|
needs: [prepare]
|
||||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
@ -78,7 +110,7 @@ jobs:
|
|||||||
- name: Build docker
|
- name: Build docker
|
||||||
run: |
|
run: |
|
||||||
cd web
|
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:${{ env.BUILD_VERSION }} .
|
||||||
|
|
||||||
- name: Login to registry git.sh-edraft.de
|
- name: Login to registry git.sh-edraft.de
|
||||||
uses: https://github.com/docker/login-action@v1
|
uses: https://github.com/docker/login-action@v1
|
||||||
|
@ -1 +0,0 @@
|
|||||||
1.2.1
|
|
Loading…
Reference in New Issue
Block a user