Merge pull request #4463 from telefonicaid/bug/4460_overloging_runtim… #439
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish pre Image from master | |
# The workflow will push PRE images from master on every merge. The images will be tagged with PRE and the next minor increase on the | |
# semver(based on the github releases) | |
# It will NOT produce releases and release images or the 'latest' tag from master. Both (releases and 'latest' tag) rely on the | |
# dockerhub autobuild feature | |
on: | |
push: | |
branches: | |
- master | |
# will produce tags in format fiware/orion:<SEMVER>-PRE-<INCREASING-NUMBER>, f.e. fiware/orion:2.6.0-PRE-12 | |
env: | |
IMAGE_NAME: fiware/orion | |
IMAGE_TAG_PRE: -PRE-${{ github.run_number }} | |
jobs: | |
deploy-release: | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Get Latest Release | |
id: latest_version | |
uses: abatilo/[email protected] | |
with: | |
owner: telefonicaid | |
repo: fiware-orion | |
- name: Echo version | |
run: | | |
echo "Version ${{ steps.latest_version.outputs.latest_tag }}" | |
- name: Increment version | |
id: increment-semver-minor | |
env: | |
LATEST_RELEASE: ${{ steps.latest_version.outputs.latest_tag }} | |
run: | | |
version=$LATEST_RELEASE | |
a=( ${version//./ } ) | |
((++a[1])) | |
a[2]=0 | |
echo "${a[0]}.${a[1]}.${a[2]}" | |
version=$(echo "${a[0]}.${a[1]}.${a[2]}") | |
echo "::set-output name=version::${version}" | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
load: true | |
tags: | | |
${{ env.IMAGE_NAME }}:${{ steps.increment-semver-minor.outputs.version }}${{ env.IMAGE_TAG_PRE }} | |
file: docker/Dockerfile | |
- name: Push | |
run: docker push ${{ env.IMAGE_NAME }}:${{ steps.increment-semver-minor.outputs.version }}${{ env.IMAGE_TAG_PRE }} |