Skip to content

fixed building

fixed building #4

Workflow file for this run

name: Build ioTSensorsOPCUA docker image
on:
pull_request:
branches: [ main, staging ]
push:
branches: [ main ]
tags: [ 'v*.*.*' ] # Push events to matching v*, i.e., v1.0, v20.15.10
jobs:
build-docker:
name: Docker Build (ioTSensorsOPCUA)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine tag name
id: prep
run: |
TAG_NAME="${{ github.ref }}"
if [[ $TAG_NAME == "refs/heads/main" ]]; then
echo "TAG_NAME=latest" >> $GITHUB_ENV
elif [[ $TAG_NAME == refs/tags/* ]]; then
echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "TAG_NAME=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: ./ioTSensorsOPCUA
file: ./ioTSensorsOPCUA/Dockerfile
push: true
tags: ghcr.io/united-manufacturing-hub/opcuasimulator:${{ env.TAG_NAME }}