Skip to content

add github action

add github action #1

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"
- 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: Install dependencies
run: |
cd ./ui
pnpm install
- name: build
run: |
pnpm run build
cp -rf ./dist/ ../docker/app
- 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: ./
# file: ./docker/zero-ui/Dockerfile
# builder: ${{ steps.buildx.outputs.name }}
# platforms: linux/amd64,linux/arm64,linux/arm
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.prep_zero-ui.outputs.tags }}