61
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Build golang services (api_gateway) (push) Has been cancelled
Go Linter / Push Docker Images (api_gateway) (push) Has been cancelled
Go Linter / Run golangci-lint (api_gateway) (push) Has been cancelled
Go Linter / Tag Commit (push) Has been skipped
Some checks failed
Deploy Production / Deploy to Staging (push) Has been skipped
Go Linter / Build golang services (api_gateway) (push) Has been cancelled
Go Linter / Push Docker Images (api_gateway) (push) Has been cancelled
Go Linter / Run golangci-lint (api_gateway) (push) Has been cancelled
Go Linter / Tag Commit (push) Has been skipped
This commit is contained in:
@@ -5,10 +5,14 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- release
|
||||
tags:
|
||||
- '*'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
@@ -27,7 +31,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.23
|
||||
go-version: 1.24
|
||||
|
||||
- name: Install golangci-lint
|
||||
run: |
|
||||
@@ -55,7 +59,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.23
|
||||
go-version: 1.24
|
||||
|
||||
- name: Build golang services
|
||||
run: |
|
||||
@@ -131,4 +135,41 @@ jobs:
|
||||
docker push $IMAGE_NAME:$IMAGE_TAG
|
||||
docker push $IMAGE_NAME:latest
|
||||
|
||||
echo "Pushed image $IMAGE_NAME:$IMAGE_TAG and :latest"
|
||||
echo "Pushed image $IMAGE_NAME:$IMAGE_TAG and :latest"
|
||||
|
||||
tag:
|
||||
name: Tag Commit
|
||||
runs-on: ubuntu-22.04
|
||||
needs: lint
|
||||
|
||||
steps:
|
||||
- name: Checkout репозитория
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get latest tag
|
||||
id: get-latest-tag
|
||||
run: |
|
||||
git fetch --tags
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo 'v0.0.0')
|
||||
|
||||
if [[ $LATEST_TAG =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
|
||||
MAJOR=${BASH_REMATCH[1]}
|
||||
MINOR=${BASH_REMATCH[2]}
|
||||
PATCH=${BASH_REMATCH[3]}
|
||||
else
|
||||
MAJOR=0
|
||||
MINOR=0
|
||||
PATCH=0
|
||||
fi
|
||||
|
||||
NEW_PATCH=$((PATCH + 1))
|
||||
NEW_TAG="v${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||
|
||||
echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Push tag
|
||||
run: |
|
||||
git tag ${{ steps.get-latest-tag.outputs.NEW_TAG }}
|
||||
git push origin ${{ steps.get-latest-tag.outputs.NEW_TAG }}
|
||||
|
||||
Reference in New Issue
Block a user