Skip to content

Update Dockerfile

Update Dockerfile #12

Workflow file for this run

name: Build Dockerfile
on:
push:
branches:
- main
env:
IMAGE_NAME: light-armv7-node
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build image
run: |
docker build . --file Dockerfile --tag $IMAGE_NAME --build-arg arg_k8s_application_commit=${{ github.sha }} --build-arg arg_k8s_application_version=${{ github.ref }} --platform=linux/arm/v7
- name: Log into registry
run: echo "${{ secrets.dockerhub_token }}" | docker login -u splitice --password-stdin
- name: Push image
run: |
IMAGE_ID=halleyassistau/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "halley-master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION