Skip to content

Update build-pack.yml #7

Update build-pack.yml

Update build-pack.yml #7

Workflow file for this run

name: CI
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }} # checkout the correct branch name
fetch-depth: 0 # fetch the whole repo history
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
cache-dependency-path: "./ui"
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: UI build & pack
run: |
cd ./ui
pnpm install
pnpm run build
mkdir -p ../docker/app
cp -rf ./dist/ ../docker/app
- name: Git Version
id: version
uses: tomerfi/version-bumper-action@2.0.1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Docker build and push
uses: docker/build-push-action@v3
with:
context: ./docker
file: ./docker/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64,linux/arm
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.version.outputs.next }}