Skip to content

Bumping UI dependencies #103

Bumping UI dependencies

Bumping UI dependencies #103

Workflow file for this run

name: Assets Build
on:
push:
branches:
- trunk
paths:
- 'assets/**'
tags:
- '*'
pull_request:
paths:
- 'assets/**'
workflow_dispatch:
inputs:
simulate_tag:
description: 'Simulate tag (e.g., v1.0.0-test)'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup Node for JS build
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: assets/package-lock.json
# Build JS assets
- name: Install JS Dependencies
working-directory: ./assets
run: npm ci
- name: Test JS Assets
working-directory: ./assets
run: npm test
# Docker steps
- name: Login to Docker Hub
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and Push Docker image
if: github.ref == 'refs/heads/trunk' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.simulate_tag != ''
working-directory: ./assets
run: |
if [[ "${{ github.event.inputs.simulate_tag }}" != "" ]]; then
TAG="${{ github.event.inputs.simulate_tag }}"
elif [[ "${{ github.ref }}" == "refs/heads/trunk" ]]; then
TAG="latest"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG="${{ github.ref_name }}"
fi
VERSION=$(grep '"version":' package.json | sed 's/.*"version": "\(.*\)",/\1/').$(git rev-parse --short HEAD)
docker build -t mwinteringham/restfulbookerplatform_assets:$TAG .
docker push mwinteringham/restfulbookerplatform_assets:$TAG
echo "VERSION=$VERSION" >> $GITHUB_ENV