Skip to content

Step: 3.12.0-next -> 4.0.0 #2

Step: 3.12.0-next -> 4.0.0

Step: 3.12.0-next -> 4.0.0 #2

name: Publish Docker image (tag)
# The workflow will push images on every tag in the format x.y.z
# Ideally, this should be done at dockerhub, but it doesn't support secrets (see https://stackoverflow.com/questions/78446824/use-environment-variables-with-sensible-information-in-docker-hub-autobuild)
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_TEF_USERNAME }}
password: ${{ secrets.DOCKERHUB_TEF_TOKEN }}
- name: Extract version from tag
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build Docker image
run: docker build -t telefonicaiot/fiware-orion:${{ env.VERSION }} --build-arg GIT_REV_ORION=${{ env.VERSION }} --build-arg REPO_ACCESS_TOKEN=${{ secrets.REPO_ACCESS_TOKEN }} --no-cache -f docker/Dockerfile .
- name: Push Docker image
run: docker push telefonicaiot/fiware-orion:${{ env.VERSION }}