This commit is contained in:
parent
313c27f3de
commit
21d844e7bd
24
.github/workflows/build.yaml
vendored
Normal file
24
.github/workflows/build.yaml
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
name: Build and push Docker container
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: metal-docker
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
- run: |
|
||||
ls -la
|
||||
if [ x"$GITHUB_REF_NAME" = xmain ];then
|
||||
NODE_RED_VERSION=latest
|
||||
else
|
||||
NODE_RED_VERSION=$GITHUB_REF_NAME
|
||||
fi
|
||||
docker build --build-arg NODE_RED_VERSION="$NODE_RED_VERSION" --progress plain --iidfile iid.txt .
|
||||
stringprefix() { [ ${#1} -le $2 ] && echo $1 && return 0 || stringprefix "${1%?}" $2 ; }
|
||||
SHORTSHA="$(stringprefix "$GITHUB_SHA" 8)"
|
||||
for TAG in "$SHORTSHA" "$GITHUB_REF_NAME";do
|
||||
docker tag "`cat iid.txt`" "$DOCKER_REGISTRY/$GITHUB_REPOSITORY:$TAG"
|
||||
docker push "$DOCKER_REGISTRY/$GITHUB_REPOSITORY:$TAG"
|
||||
done
|
||||
|
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
.*
|
||||
!.git?*
|
||||
|
||||
*~
|
||||
\#*#
|
22
Dockerfile
Normal file
22
Dockerfile
Normal file
|
@ -0,0 +1,22 @@
|
|||
ARG NODE_RED_VERSION=latest
|
||||
|
||||
FROM nodered/node-red:${NODE_RED_VERSION}
|
||||
|
||||
USER root
|
||||
|
||||
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
|
||||
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
||||
|
||||
RUN set -x \
|
||||
&& apk update \
|
||||
&& apk upgrade \
|
||||
&& apk add --no-cache \
|
||||
ttf-freefont \
|
||||
chromium \
|
||||
# Cleanup
|
||||
&& apk del --no-cache make gcc g++ binutils-gold gnupg libstdc++ \
|
||||
&& rm -rf /usr/include \
|
||||
&& rm -rf /var/cache/apk/* /root/.node-gyp /usr/share/man /tmp/* \
|
||||
&& echo
|
||||
|
||||
USER 1000
|
Loading…
Reference in New Issue
Block a user