Skip to content

restore original run from master branch #75

restore original run from master branch

restore original run from master branch #75

Workflow file for this run

name: publish docker image
on:
workflow_dispatch:
push:
branches:
- "master"
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '17 3 * * 0'
jobs:
build:
env:
# Setting the defaults up front
LATEST_NODE: 20
DEFAULT_IMAGE: smilerz/node-red
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get Date
id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%SZ')"
run : echo "date=$(date +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
images: |
${{ env.DEFAULT_IMAGE }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Get Node-RED Version
id: nrVersion
run: |
TAGS=""
echo Original tags ${{ steps.meta.outputs.tags }}
if [[ ! -z "${{ github.event.inputs.version }}" ]]; then
TRAVIS_TAG=${{ github.event.inputs.version }}
else
TRAVIS_TAG=$(echo $GITHUB_REF | awk -F '/' '{ print $3}')
fi
if [[ "$TRAVIS_TAG" =~ ^v[0-9\.-]*$ ]]; then
# release build
IMAGE=${{ env.DEFAULT_IMAGE }}
PUSH=true
VERSION=${TRAVIS_TAG:1}
STABLE_VERSION=`echo ${VERSION} | sed -r 's/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$/\1.\2/'`
TAGS="$IMAGE:latest-debian,$IMAGE:$VERSION-debian,$IMAGE:$STABLE_VERSION-debian"
else
IMAGE=${{ env.DEV_IMAGE }}
if [[ "$TRAVIS_TAG" == *"dev"* || "$TRAVIS_TAG" == *"beta"* ]]; then
# beta build
PUSH=true
else
PUSH=false
fi
VERSION=${TRAVIS_TAG}
TAGS="$IMAGE:$VERSION-debian"
fi
echo $TAGS
echo "tags=$TAGS" >> $GITHUB_OUTPUT
echo "push=$PUSH" >> $GITHUB_OUTPUT
echo "version=$TRAVIS_TAG" >> $GITHUB_OUTPUT
echo "buildVersion=$VERSION" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Build and push
id: build-push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64, linux/arm64, linux/arm/v7
file: .docker/Dockerfile.debian
push: ${{ steps.nrVersion.outputs.push }}
build-args: |
NODE_VERSION=${{ env.LATEST_NODE }}
BUILD_DATE=${{ steps.date.outputs.date }}
BUILD_REF=${{ env.GITHUB.SHA }}
TAG_SUFFIX=-debian
NODE_RED_VERSION=${{ steps.nrVersion.outputs.version }}
BUILD_VERSION=${{ steps.nrVersion.outputs.buildVersion }}
tags: ${{ steps.nrVersion.outputs.tags }}