Skip to content

Merge branch 'main' into main #14

Merge branch 'main' into main

Merge branch 'main' into main #14

Workflow file for this run

name: Publish to DockerHub
on:
push:
branches:
- main
release:
types:
- published
env:
DOCKER_USER: bilts
jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Log into registry
run: echo "${{ secrets.DOCKERHUB }}" | docker login -u "${DOCKER_USER}" --password-stdin
- name: Setup Node
run: |
npm install
- name: Build and publish images
run: |
# For tagged versions, translate e.g. "refs/tags/v1.2.3" -> "1.2.3"
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# For the main branch, use "latest" as the version
[ "${VERSION}" == "main" ] && VERSION=latest
[ "${VERSION}" == "harmony-412" ] && VERSION=latest
# build and publish images for all services
VERSION="${VERSION}" lerna run build
VERSION="${VERSION}" lerna run publish