Skip to content

Merge pull request #4417 from telefonicaid/hardening/debian12-migration #21

Merge pull request #4417 from telefonicaid/hardening/debian12-migration

Merge pull request #4417 from telefonicaid/hardening/debian12-migration #21

Workflow file for this run

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 }}