More adjusts on github actions
This commit is contained in:
parent
21a6fcc3d2
commit
b76daa32f1
1 changed files with 9 additions and 2 deletions
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
|
|
@ -99,6 +99,10 @@ jobs:
|
||||||
push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }}
|
push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
tags: "${{ steps.tags.outputs.result }}"
|
||||||
|
|
||||||
|
|
||||||
# - name: Docker Hub Description
|
# - name: Docker Hub Description
|
||||||
# if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
# if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
||||||
|
|
@ -122,10 +126,13 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
|
|
||||||
|
- name: Get result
|
||||||
|
run: echo "${{ needs.Build.outputs.tags }}"
|
||||||
|
|
||||||
- name: Update versions
|
- name: Update versions
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ steps.tags.outputs.result }}"
|
TAG="${{ needs.Build.outputs.tags }}"
|
||||||
CURRENT_VERSION=$(grep "appVersion: " helm/easyhaproxy/Chart.yaml | sed 's#appVersion: "\(.*\)"#\1#g')
|
CURRENT_VERSION=$(grep "appVersion: " helm/easyhaproxy/Chart.yaml | sed 's#appVersion: "\(.*\)"#\1#g')
|
||||||
|
|
||||||
if [ "$TAG" = "$CURRENT_VERSION" ]; then
|
if [ "$TAG" = "$CURRENT_VERSION" ]; then
|
||||||
|
|
@ -145,9 +152,9 @@ jobs:
|
||||||
sed -i "s#chart: easyhaproxy-[a-zA-Z0-9\.]*#chart: easyhaproxy-$NEW_VERSION#g" deploy/kubernetes/easyhaproxy-*.yml
|
sed -i "s#chart: easyhaproxy-[a-zA-Z0-9\.]*#chart: easyhaproxy-$NEW_VERSION#g" deploy/kubernetes/easyhaproxy-*.yml
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "[skip ci] Update from $CURRENT_VERSION to $TAG"
|
|
||||||
git config --global user.name "$GITHUB_ACTOR CI/CD"
|
git config --global user.name "$GITHUB_ACTOR CI/CD"
|
||||||
git config --global user.email "info@byjg.com.br"
|
git config --global user.email "info@byjg.com.br"
|
||||||
|
git commit -m "[skip ci] Update from $CURRENT_VERSION to $TAG"
|
||||||
git push
|
git push
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue