Skip to content

update copy commands to .docker source #73

update copy commands to .docker source

update copy commands to .docker source #73

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: 16
DEFAULT_IMAGE: smilerz/node-red
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Get Node-RED Version
id: nrVersion
run: |
TAGS=""
while IFS= read -r TAG;do
if [ -z "$TAGS" ]; then
TAGS=$TAG
else
TAGS="$TAGS,$TAG"
fi
done <<< "${{ steps.meta.outputs.tags }}"
echo "Start Tags = $TAGS"
echo "GITHUB_REF = $GITHUB_REF"
echo "version = ${{ github.event.inputs.version }}"
if [[ ! -z "${{ github.event.inputs.version }}" ]]; then
TEMP=${{ github.event.inputs.version }}
TEMP=${TEMP:1}
TEMP2=$(echo $GITHUB_REF | awk -F '/' '{ print $3}')
echo "$GITHUB_REF - $TEMP"
TAGS=$(echo $TAGS | sed "s/$TEMP2/$TEMP/")
TRAVIS_TAG=${{ github.event.inputs.version }}
else
TRAVIS_TAG=$(echo $GITHUB_REF | awk -F '/' '{ print $3}')
fi
echo $TAGS
echo "tags=$TAGS" >> $GITHUB_OUTPUT
echo "push=$PUSH" >> $GITHUB_OUTPUT
echo "buildVersion=$VERSION" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
# echo "::set-output name=tags::$TAGS"
# echo "::set-output name=push::$PUSH"
# echo "::set-output name=buildVersion::$VERSION"
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Get Date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%SZ')"
- name: Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DEFAULT_IMAGE }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
id: build-push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
file: .docker/Dockerfile.debian
pull: true
push: true
build-args: |
NODE_VERSION=${{ env.LATEST_NODE }}
BUILD_DATE=${{ steps.date.outputs.date }}
BUILD_REF=${{ env.GITHUB.SHA }}
NODE_RED_VERSION=${{ steps.nrVersion.outputs.version }}
BUILD_VERSION=${{ steps.nrVersion.outputs.buildVersion }}
tags: ${{ steps.meta.outputs.tags }}