Skip to content

Build

Build #38

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn test
# Only on version tag
- name: Get package version
id: get_version
run: |
echo "VERSION3=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
echo "VERSION2=$(node -p "require('./package.json').version.split('.').slice(0, 2).join('.')")" >> "$GITHUB_OUTPUT"
- uses: docker/login-action@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
if: startsWith(github.ref, 'refs/tags/v')
- uses: docker/build-push-action@v5
if: startsWith(github.ref, 'refs/tags/v')
with:
context: .
push: true
tags: |
thgh/hivepanel:${{ steps.get_version.outputs.VERSION3 }}
thgh/hivepanel:${{ steps.get_version.outputs.VERSION2 }}
thgh/hivepanel:latest
platforms: linux/amd64,linux/arm64/v8